开发者

delayed_job and rails 3 not loading jobs

开发者 https://www.devze.com 2023-01-15 13:35 出处:网络
I am trying to start the delayed_job daemon but it\'s returning the following error. $ rake jobs:work

I am trying to start the delayed_job daemon but it's returning the following error.

$ rake jobs:work

*** Starting job worker host:Kelvin-Pompeys-MacBo开发者_高级运维ok-Pro.local pid:4712 rake aborted! Job failed to load: invalid subclass. Try to manually require the required file.

After a bit of Googling I found the link below which suggests that I require my models in an initializer but I am new to ruby and rails and I don't quite know how to go about implementing this. Any assistance appreciated.

http://github.com/collectiveidea/delayed_job/issues/issue/65


Create config/initializers/delayed_job.rb. In this file just require anything you need to de-serialize. Like if your job class is MyJob and it is located in app/models/my_job.rb:

require 'my_job'

0

精彩评论

暂无评论...
验证码 换一张
取 消