Unicornをstartさせる時にエラーが出て困っております。
環境
AWS EC2
OS:Amazon Linux
Rails: 4.2.6
Ruby: 2.2.2
nginx: 1.8.1
unicorn: 5.1.0
エラー文
unicorn_rails -c /var/www/rails/rails_app/config/unicorn.conf.rb -D -E production
↑を叩くと、
↓が出る。
/home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/lib/unicorn/configurator.rb:88:in `block in reload': directory for pid=/var/www/rails/rails_app/tmp/pids/unicorn.pid not writable (ArgumentError) from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/lib/unicorn/configurator.rb:84:in `each' from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/lib/unicorn/configurator.rb:84:in `reload' from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/lib/unicorn/configurator.rb:65:in `initialize' from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:76:in `new' from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:76:in `initialize' from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/bin/unicorn_rails:209:in `new' from /home/ec2-user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.1.0/bin/unicorn_rails:209:in `<top (required)>' from /home/ec2-user/.rbenv/versions/2.2.2/bin/unicorn_rails:23:in `load' from /home/ec2-user/.rbenv/versions/2.2.2/bin/unicorn_rails:23:in `<main>' master failed to start, check stderr log for details
rails_app/tmp/pids/unicorn.pidをtouchで作ったりしましたがダメでした。
unicornの設定
unicorn.conf.rb
1$worker = 2 2$timeout = 30 3$app_dir = "/var/www/rails/rails_app" 4$listen = '/var/www/rails/rails_app/tmp/sockets/.unicorn.sock' 5$pid = '/var/www/rails/rails_app/tmp/pids/unicorn.pid' 6$std_log = '/vae/www/rails/rails_app/log/unicorn.log' 7# set config 8worker_processes $worker 9working_directory $app_dir 10stderr_path $std_log 11stdout_path $std_log 12timeout $timeout 13listen $listen 14pid $pid 15# loading booster 16preload_app true 17# before starting processes 18before_fork do |server, worker| 19 defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! 20 old_pid = "#{server.config[:pid]}.oldbin" 21 if old_pid != server.pid 22 begin 23 Process.kill "QUIT", File.read(old_pid).to_i 24 rescue Errno::ENOENT, Errno::ESRCH 25 end 26 end 27end 28# after finishing processes 29after_fork do |server, worker| 30 defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection 31end
これまでやったこと
rails_app/tmp/pids/unicorn.pidを手動で作成
「unicorn.pid not writable」などでググるも同じ現象のひとがおらず。。。
初めて自分でサーバーを立てようとしているのですが、四苦八苦です。
どうか皆様のお力を貸してください!

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。
2016/09/14 01:35 編集
2016/09/14 01:37 編集
2016/09/14 01:43