RAILS_SERVE_STATIC_FILES=1 unicorn_rails -c config/unicorn.rb -E production -D
コマンドにてUnconを起動しようとしたのですが、
このようなエラーが出て困っています。。
app_pathが原因なのかな?
とは思っているのですが、どう書き換えればいいかわかりません。。
わかる方がいたらご教授お願いします。
]$ RAILS_SERVE_STATIC_FILES=1 unicorn_rails -c config/unicorn.rb -E production -D Traceback (most recent call last): 10: from /home/ec2-user/.rbenv/versions/2.6.5/bin/unicorn_rails:23:in `<main>' 9: from /home/ec2-user/.rbenv/versions/2.6.5/bin/unicorn_rails:23:in `load' 8: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in `<top (required)>' 7: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in `new' 6: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:77:in `initialize' 5: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:77:in `new' 4: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:77:in `initialize' 3: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:84:in `reload' 2: from /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:84:in `instance_eval' 1: from config/unicorn.rb:7:in `reload' /home/ec2-user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:592:in `working_directory': config_file=config/unicorn.rb would not be accessible in working_directory=/var/www/current (ArgumentError) master failed to start, check stderr log for details
unicorn
1 2app_path = File.expand_path('../../../', __FILE__) 3 4 5worker_processes 1 6 7working_directory "#{app_path}/current" 8 9listen "#{app_path}/shared/tmp/sockets/unicorn.sock" 10 11pid "#{app_path}/shared/tmp/pids/unicorn.pid" 12 13stderr_path "#{app_path}/shared/log/unicorn.stderr.log" 14 15stdout_path "#{app_path}/shared/log/unicorn.stdout.log" 16 17timeout 60 18 19 20 21preload_app true 22GC.respond_to?(:copy_on_write_friendly=) && GC.copy_on_write_friendly = true 23 24check_client_connection false 25 26run_once = true 27 28before_fork do |server, worker| 29 defined?(ActiveRecord::Base) && 30 ActiveRecord::Base.connection.disconnect! 31 32 if run_once 33 run_once = false 34 end 35 36 old_pid = "#{server.config[:pid]}.oldbin" 37 if File.exist?(old_pid) && server.pid != old_pid 38 begin 39 sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU 40 Process.kill(sig, File.read(old_pid).to_i) 41 rescue Errno::ENOENT, Errno::ESRCH => e 42 logger.error e 43 end 44 end 45end 46 47after_fork do |_server, _worker| 48 defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection 49end
ls -ld /var/www/rails/rails_app/tmp/pids ls: /var/www/rails/rails_app/tmp/pids にアクセスできません: No such file or directory [ec2-user@i***** ~]$ ls -l /var/www/rails/rails_app/tmp/pids/unicorn.pid ls: /var/www/rails/rails_app/tmp/pids/unicorn.pid にアクセスできません: No such file or directory [ec2-user@*****~]$ id uid=1000(ec2-user) gid=1000(ec2-user) groups=1000(ec2-user),4(adm),10(wheel),190(systemd-journal),992(docker)
あなたの回答
tips
プレビュー