delayed job's task problem with rails 2.3.5

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.


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.


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.

链接地址: http://www.djcxy.com/p/41916.html

上一篇: 删除AWS / S3存储桶时出现TypeError错误

下一篇: 使用rails 2.3.5延迟作业的任务问题