我試圖重新啓動,像這樣我的delayed_job工作者:重新啓動的delayed_job與Capistrano的
task :restart_dj do
on roles(:app) do
execute "RAILS_ENV=production #{File.join(current_path,'bin','delayed_job')} restart"
end
end
不幸的是,我得到這個:
DEBUG [64a01587] Command: /usr/bin/env ln -s /home/me/rails/dino/releases/20160906142152 /home/me/rails/dino/releases/current
INFO [64a01587] Finished in 0.177 seconds with exit status 0 (successful).
INFO [713c695b] Running /usr/bin/env mv /home/me/rails/dino/releases/current /home/me/rails/dino as [email protected]
DEBUG [713c695b] Command: /usr/bin/env mv /home/me/rails/dino/releases/current /home/me/rails/dino
INFO [713c695b] Finished in 0.349 seconds with exit status 0 (successful).
INFO [7c2e9550] Running RAILS_ENV=production /home/me/rails/dino/current/bin/delayed_job restart as [email protected]
DEBUG [7c2e9550] Command: RAILS_ENV=production /home/me/rails/dino/current/bin/delayed_job restart
DEBUG [7c2e9550] /home/me/rails/dino/releases/20160906142152/config/boot.rb:1:in `<top (required)>'
DEBUG [7c2e9550] :
DEBUG [7c2e9550] undefined local variable or method `__dir__' for main:Object
DEBUG [7c2e9550] (
DEBUG [7c2e9550] NameError
DEBUG [7c2e9550] )
DEBUG [7c2e9550] from /home/me/rails/dino/releases/20160906142152/config/application.rb:1:in `require_relative'
DEBUG [7c2e9550] from /home/me/rails/dino/releases/20160906142152/config/application.rb:1:in `<top (required)>'
DEBUG [7c2e9550] from /home/me/rails/dino/current/config/environment.rb:2:in `require_relative'
DEBUG [7c2e9550] from /home/me/rails/dino/current/config/environment.rb:2:in `<top (required)>'
DEBUG [7c2e9550] from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
DEBUG [7c2e9550] from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
DEBUG [7c2e9550] from /home/me/rails/dino/current/bin/delayed_job:3:in `<main>'
不過,我可以在我的生產控制檯上運行RAILS_ENV=production bin/delayed_job restart
沒有任何問題。
我在使用Ruby 2.3.1。
爲什麼不'''執行「RAILS_ENV =生產bin/delayed_job restart」'''' – Nathan