Kelvin Pompey
Kelvin Pompey

Reputation: 11

delayed_job and rails 3 not loading jobs

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-MacBook-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

Upvotes: 1

Views: 727

Answers (1)

Kevin Gilpin
Kevin Gilpin

Reputation: 21

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'

Upvotes: 2

Related Questions