2

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 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.

4

1 回答 1

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"

当然让我更容易了=)

于 2011-08-26T08:43:33.920 回答