Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I fixed this problem by switching to delayed_job (DJ) version 2.1.2.</p> <p>I am using: rvm ruby 1.8.7 (2010-01-10 patchlevel 249) rails 3.0.9</p> <p>Gemfile: gem "delayed_job", '2.1.2'</p> <p>Before this I tried to use the latest version of delayed_job: gem "delayed_job", :git => 'git://github.com/collectiveidea/delayed_job.git' for me it was v3.0.0.pre</p> <p>But: rails generate delayed_job didn't generate migrations file. I created it manually. Then after 'rake db:migrate' I've got the table for storing delayed_job queue. And then, when I was thinking that all must be worked correctly, I've got the same error.</p> <p>When I tried to find the source of this error, in 'delayed_jobs' table I have found that delayed_job's tasks are incorrectly saved. Here is snippet from field 'handler' in 'delayed_jobs' table:</p> <pre><code>--- !ruby/object:Delayed::PerformableMailer object: !ruby/class Notifier </code></pre> <p>As I know, delayed_job gets all tasks through Struct class, so the task should be saved with '!ruby/struct' header isntead of '!ruby/object' Here is the snippet of correctly saved task:</p> <pre><code>--- !ruby/struct:Delayed::PerformableMailer object: !ruby/class Notifier </code></pre> <p>To check this I stopped delaed_job process in console. Then I called some method to put DJ's task to DB:</p> <pre><code>Notifier.delay.some_email(current_user, @event_message) </code></pre> <p>Then I manually replaced '!ruby/object' by '!ruby/struct' in 'handler' field. Then I started DJ 'rake jobs:work', it said me that mail was succesfully sent. </p> <p>But: - this task wasn't be deleted from DJ's table - and mail doesn't get to the recipient</p> <p>So I've decided that it is a bug in new version of delayed_job. I switched to DJ '2.1.2' and it's worked for me fine.</p> <p>P.S.: Sorry for my English :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload