Delayed_job not working (rails 3.1.3)

Trying to use the gem delayed_job from collectidea (https://github.com/collectiveidea/delayed_job) in my project, but this throws an exception: "uninitialized constant Delayed :: DelayProxy :: Job".

What I did 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 the controller:

 Video.delay.convert 

I did all this as in the instructions, but it will not work. Googled has a lot, but cannot find useful instructions. I found railscasts sources with delay_work function, but all the code (Gemfile, script, controllers, models) is the same as mine, but the RC code works, mine is not.

PS: I'm new to ruby ​​and rails, maybe my question is lame, but I'm trying to solve this problem on the second day. And ... sorry for my bad english :)

+6
source share
2 answers

From the comment above:

All I had to do was write an initializer (initializers / delayed_job_config.rb): Delayed :: Worker.backend =: active_record and restart the web server. It does not apply without a restart, even in a development environment.

+2
source

Try the following:

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

Source: https://habr.com/ru/post/906428/


All Articles