Rails - 更新 Rails 后延迟作业失败?
我已经更新了一些gems,即将rails升级到版本3.0.7
该项目中有相当多的delayed_jobs,但是现在当我用命令在终端中启动作业时:
rake jobs:work
我收到一个错误消息说:
undefined method `task' for #<MyAppName::Application:0x10350ab78>
当前的 rake 文件包含以下内容,与延迟的作业有关,我认为:
MyAppName::Application.load_tasks
我想知道是否有新人如何解决此问题并使延迟的作业再次运行。
据我所知,将作业添加到数据库没有问题,问题纯粹在于通过终端在本地机器上启动任务。
谢谢!
I've updated a couple of gems and what not, namely upgraded rails to version 3.0.7
The project has quite a few delayed_jobs in it, however now when I come to start the jobs in the terminal with the command:
rake jobs:work
I get an error message saying:
undefined method `task' for #<MyAppName::Application:0x10350ab78>
The rake file current has the follwing in it, in realation to delayed jobs I think:
MyAppName::Application.load_tasks
I was wondering if anyone new how to fix this problem and get delayed jobs running again.
Also as far as I can tell there is no problem with adding the jobs to the db, the problem is purly with starting the tasks on my local machen via the terminal.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此修复对我有用
使用 Rake 的未定义方法“任务” 0.9.0
This fix worked for me
Undefined method 'task' using Rake 0.9.0
你升级了耙子吗?显然 Rake 0.9 破坏了 Rails 3.0.7:
Did you upgrade rake? Apparently Rake 0.9 broke Rails 3.0.7:
您是否尝试过更新到最新的delayed_job插件?运行
捆绑安装
?如果运行rails script/delayed_job start
会发生什么?Have you tried updating to the latest delayed_job plugin? run
bundle install
? what happens if you runrails script/delayed_job start
?