Rails 2.3.5 的延迟作业任务问题

发布于 2024-11-19 14:07:39 字数 3526 浏览 2 评论 0原文

我正在使用 ruby​​gem 延迟作业,但无法成功运行 rake 任务。我参考了 https://github.com/collectiveidea/delayed_job/tree/v2。 0。顺便说一句,我正在使用捆绑器。

#Gemfile
gem 'delayed_job', '~>2.0.4'
#Rake file
begin
  gem 'delayed_job', '~>2.0.4'
  require 'delayed/tasks'
rescue LoadError
  STDERR.puts "Run `bundle` to install delayed_job"
end

运行 rake jobs:work --trace 时,它显示以下错误

rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke jobs:work (first_time)
** Invoke merb_env (first_time)
** Execute merb_env
** Invoke environment (first_time)
** Execute environment
** Execute jobs:work
rake aborted!
Anonymous modules have no name to be referenced by
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:585:in `to_constant_name'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:391:in `qualified_name_for'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:104:in `rescue in const_missing'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:94:in `const_missing'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/delayed_job-2.0.6/lib/delayed/tasks.rb:13:in `block (2 levels) in '
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/bin/rake:32:in `'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/bin/rake:19:in `load'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/bin/rake:19:in `'
Tasks: TOP => jobs:work

我尝试延迟作业 Rake 任务失败但这并没有解决我的问题。

谁能描述一下这里发生了什么? 谢谢。

I am using rubygem delayed job but not able to run rake task successfully. I took reference of https://github.com/collectiveidea/delayed_job/tree/v2.0. BTW, i am using bundler.

#Gemfile
gem 'delayed_job', '~>2.0.4'
#Rake file
begin
  gem 'delayed_job', '~>2.0.4'
  require 'delayed/tasks'
rescue LoadError
  STDERR.puts "Run `bundle` to install delayed_job"
end

While running rake jobs:work --trace, it displays below error

rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke jobs:work (first_time)
** Invoke merb_env (first_time)
** Execute merb_env
** Invoke environment (first_time)
** Execute environment
** Execute jobs:work
rake aborted!
Anonymous modules have no name to be referenced by
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:585:in `to_constant_name'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:391:in `qualified_name_for'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:104:in `rescue in const_missing'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:94:in `const_missing'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/delayed_job-2.0.6/lib/delayed/tasks.rb:13:in `block (2 levels) in '
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rake-0.9.2/bin/rake:32:in `'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/bin/rake:19:in `load'
/Users/me/.rvm/gems/ruby-1.9.2-p180@suga/bin/rake:19:in `'
Tasks: TOP => jobs:work

I tried Delayed Job Rake Task Failing but it didn't solve my problem.

Can anyone describes what is happening here?
Thanks.

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

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

发布评论

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

评论(2

青衫负雪 2024-11-26 14:07:39

啊!你知道,调试 DJ 是件痛苦的事。

此错误消息:

=> Aonymous modules have no name to be referenced by

意味着您的其中一个型号拼写错误。

例如:Categorizatoin 而不是 Categorizatoin

因此,请检查 DJ 中的模型并检查所有模型的拼写。

Ah! Debugging DJ is a pain in the you know what.

This error message:

=> Aonymous modules have no name to be referenced by

Means that you have spelled one of your models incorrectly.

For example: Categorizatoin instead of Categorizatoin.

So go through your Models in DJ and check your spelling on all of your models.

风月客 2024-11-26 14:07:39

我真的不明白为什么 DJ 在 Rails 版本 2.3 中使用 gem 无法正常工作。请确保您已经安装了 gem 插件,然后按照文档说明进行操作。我希望这不会给您带来匿名模块问题。

I really don't understand why DJ won't work properly using gem in 2.3 of rails version.Make sure you have installed plugin instead for gem and then do as the documetation says. I hope this won't give you anonymous module problem.

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