Alexey Krasnoperov
Alexey Krasnoperov

Reputation: 93

delayed_job doesn't work (rails 3.1.3)

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 :)

Upvotes: 6

Views: 3038

Answers (2)

msroot
msroot

Reputation: 837

Try this:

gem 'delayed_job_active_record', :git => 'git://github.com/collectiveidea/delayed_job_active_record.git'

Upvotes: 1

Alexey Krasnoperov
Alexey Krasnoperov

Reputation: 93

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.

Upvotes: 2

Related Questions