开发者

Error when trying to run delayed_job in production

开发者 https://www.devze.com 2023-03-31 02:45 出处:网络
I am using delayed_job to send emails, everything works fine under development when starting the process using:

I am using delayed_job to send emails, everything works fine under development when starting the process using:

jobs:work

The problem comes on my shared host, under开发者_如何学C production, when I try and start the process using the "delayed_job" script (as detailed here)

script/delayed_job start staging

gives me the following error

/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

Any ideas on how to resolve this please?

I am using Rails 3.1 on Ruby 1.8.7, with Phusion Passenger.


I would suggest using Capistrano for these kind of things. Then you could simply put this in your deploy.rb file (or Capfile):

require 'delayed/recipes'

after "deploy:start", "delayed_job:start"
after "deploy:stop", "delayed_job:stop"
after "deploy:restart", "delayed_job:restart"

Certainly made it a lot easier for me =)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号