【发布时间】:2018-09-21 22:48:16
【问题描述】:
我正在使用 capistrano 3.2.1 和 capistrano-resque gem 来重新启动部署时的 rasque 工作人员。总是出现这个错误。
如果我在生产服务器的当前目录下手动启动工作程序,它可以正常启动。
cd /home/azureuser/apps/app_production/current && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env nohup RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 ~/.rbenv/bin/rbenv exec bundle exec rake RACK_ENV=production RAILS_ENV=production QUEUE="mailer" PIDFILE=/home/azureuser/apps/app_production/shared/tmp/pids/resque_work_1.pid BACKGROUND=yes VERBOSE=1 INTERVAL=5 environment resque:work >> log/resque.log 2>> log/resque.log )
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as azureuser@thesend.cloudapp.net: nohup exit status: 127
nohup stdout: Nothing written
nohup stderr: Nothing written
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: nohup exit status: 127
【问题讨论】:
-
失败时会写入
apps/app_production/current/log/resque.log什么? -
ohup:无法运行命令“RBENV_ROOT=/home/azureuser/.rbenv”:没有这样的文件或目录。这是错误日志。
-
如果我检查 'which rbenv' 它会记录 '/home/azureuser/.rbenv/bin/rbenv'
-
@MattBrictson 提交了 github 问题。 github.com/sshingler/capistrano-resque/issues/101。您是否有其他建议来完成这项工作。 (在 cap 部署时重新启动 resque 工作人员)?
-
降级到 0.2.1 是一种解决方法
标签: ruby-on-rails capistrano resque rbenv capistrano3