使用Capistrano和Rails配置延迟的作业4 [英] Configuring Delayed Jobs with Capistrano and Rails 4

查看:65
本文介绍了使用Capistrano和Rails配置延迟的作业4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让Capistrano使用Rails 4应用程序启动/停止延迟作业。我遵循了此处的说明,但它说的是Rails 3。现在是这样配置的:

I am trying to get Capistrano to start/stop Delayed Jobs with a Rails 4 application. I followed the instructions here, but it says Rails 3. This is how its configured now:

deploy.rb:

require 'delayed/recipes'
after "deploy:start", "delayed_job:start" 
after "deploy:stop", "delayed_job:stop" 
after "deploy:restart", "delayed_job:stop","delayed_job:start"

当我尝试部署时在尝试执行 RAILS_ENV =生产脚本/ delayed_job停止

When I try to deploy I get the following error after it tries to execute RAILS_ENV=production script/delayed_job stop

sh: script/delayed_job: not found


推荐答案

找到了解决方法(设置:delayed_job_command, bin / delayed_job ),希望这对其他人有帮助!

Found the workaround (set :delayed_job_command, "bin/delayed_job") and hope this helps someone else!

deploy.rb:

require 'delayed/recipes'
set :delayed_job_command, "bin/delayed_job"
after "deploy:start", "delayed_job:start"
after "deploy:stop", "delayed_job:stop"
after "deploy:restart", "delayed_job:stop","delayed_job:start"

这篇关于使用Capistrano和Rails配置延迟的作业4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆