我正在使用delayed_job发送电子邮件,使用以下内容启动流程时,一切正常;
jobs:work
当我尝试使用“delayed_job”脚本(详细here)启动流程时,问题出现在我的共享主机上,正在制作中
script/delayed_job start staging
给我以下错误
/home/blog/applications/staging/blog/shared/bundle/ruby/1.8/gems/activesupport-3.1.0.rc6/lib/active_support/dependencies.rb:237:in `require': no such file to load -- delayed/command (LoadError)
from /home/blog/applications/staging/blog/shared/bundle/ruby/1.8/gems/activesupport-3.1.0.rc6/lib/active_support/dependencies.rb:237:in `require'
from /home/blog/applications/staging/blog/shared/bundle/ruby/1.8/gems/activesupport-3.1.0.rc6/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/blog/applications/staging/blog/shared/bundle/ruby/1.8/gems/activesupport-3.1.0.rc6/lib/active_support/dependencies.rb:636:in `new_constants_in'
from /home/blog/applications/staging/blog/shared/bundle/ruby/1.8/gems/activesupport-3.1.0.rc6/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/blog/applications/staging/blog/shared/bundle/ruby/1.8/gems/activesupport-3.1.0.rc6/lib/active_support/dependencies.rb:237:in `require'
from script/delayed_job:4
有关如何解决这个问题的任何想法吗?
我在Ruby 1.8.7上使用Rails 3.1,使用Phusion Passenger。
答案 0 :(得分:0)
我建议使用Capistrano来做这些事情。 然后你可以简单地将它放在deploy.rb文件(或Capfile)中:
require 'delayed/recipes'
after "deploy:start", "delayed_job:start"
after "deploy:stop", "delayed_job:stop"
after "deploy:restart", "delayed_job:restart"
当然让我更容易=)