尝试在生产中运行delayed_job时出错

发布于 2024-12-01 10:16:25 字数 1405 浏览 0 评论 0 原文

我正在使用delayed_job发送电子邮件,在开发过程中启动进程时一切正常:

jobs:work

问题出现在我的共享主机上,在生产中,当我尝试使用“delayed_job”脚本启动进程时(详细信息此处

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。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巷雨优美回忆 2024-12-08 10:16:25

我建议使用 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"

当然对我来说更容易=)

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 =)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文