Trying to use gem delayed_job from collectiveidea(https://github.com/collectiveidea/delayed_job) in my project, but it throws exception: "uninitialized constant Delayed::DelayProxy::Job".
What I've done to install it: Gemfile:
gem 'daemons'
gem 'delayed_job'
gem 'delayed_job_active_record'
Command line:
bundle install
rails generate delayed_job:active_record
rake db:migrate
rake jobs:work
Using it in controller:
Video.delay.convert
I've done all of this like in instruction, but it doesn't work. Googled much, but can't find helpful instruction. I've found railscasts sources with delay_work, but all code(Gemfile, script, controllers, models) is the same as mine, but RC's code works, mine - no.
P.S.: I'm new to ruby and rails, may be my question is lame, but I'm trying to solve this problem second day. And... sorry for my bad english :)
From the comment above:
All I needed to do is to write to initializer(initializers/delayed_job_config.rb): Delayed::Worker.backend = :active_record And restart the web-server. It doesn't apply without restart even in develop environment.
Try this:
gem 'delayed_job_active_record', :git => 'git://github.com/collectiveidea/delayed_job_active_record.git'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With