第一次问一个问题。我一直在尝试使用Capistrano部署我的Rails站点,部署总是失败并显示:
DEBUG [93ee946b] Command: cd /home/deployer/apps/rails/current && ( RAILS_ENV=production /usr/local/rvm/bin/rvm default do bundle exec unicorn -c /home/deployer/apps/rails/current/config/unicorn/production.rb -E deployment -D )
DEBUG [93ee946b] master failed to start, check stderr log for details
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployer@a-website.com: bundle exit status: 1
bundle stdout: Nothing written
bundle stderr: master failed to start, check stderr log for details
SSHKit::Command::Failed: bundle exit status: 1
bundle stdout: Nothing written
bundle stderr: master failed to start, check stderr log for details
Tasks: TOP => unicorn:start
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deployer@a-website.com: bundle exit status: 1
bundle stdout: Nothing written
bundle stderr: master failed to start, check stderr log for details
检查unicorn.log时,最后一个条目显示:
I, [2015-12-08T10:42:06.378448 #8701] INFO -- : pid=/var/run/unicorn.pid possibly stale, got EPERM signalling PID:1112
/home/deployer/apps/rails/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:186:in `initialize': Permission denied @ rb_sysopen - /var/run/0.8564584425589807.8701 (Errno::EACCES)
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:186:in `open'
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:186:in `clobber_pid'
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:221:in `pid='
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:135:in `start'
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/bin/unicorn:23:in `load'
from /home/deployer/apps/rails/shared/bundle/ruby/2.2.0/bin/unicorn:23:in `<main>'
只是一些背景信息,我之前以root用户身份部署了我的网站,但后来切换到名为“deployer”的新用户并且一直在尝试进行适当的更改。这可能是权限问题,但我似乎无法确定问题所在。有什么想法吗?