delayed_job: NoMethodError with delayed_job

I am trying to implement delayed_job for a mailer on a rails 3.1.0 app locally with ruby 1.8.7 .

Following the documentation I am making the delay call from my controller as follows:

EventMailer.delay.event_message_email(current_user, @event_message)

This causes the task to be added to the job table but when I run rake jobs:work it logs the following error:

Class#event_message_email failed with NoMethodError: undefined method `event_message_email' for Class:Class - 6 failed attempts

Calling the mailer method without delay works fine, and I am running it on the default rails server so its not the issue with Thin mentioned in the FAQ. Any idea whats wrong? Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 15 years ago
  • Comments: 28 (1 by maintainers)

Most upvoted comments

Have you restared the job runner? It could be something as simple as that.

Otherwise, check that it is saving EventMailer in the jobs table.

-Daniel

Daniel Morrison [i] Collective Idea http://collectiveidea.com http://ideafoundry.info 25 West 8th Street, Suite 200 Holland, MI 49423 616-990-0155 daniel@collectiveidea.com

On Dec 22, 2011, at 11:14 AM, tshr wrote:

I am trying to implement delayed_job for a mailer on a rails 3.1.0 app locally with ruby 1.8.7 .

Following the documentation I am making the delay call from my controller as follows:

EventMailer.delay.event_message_email(current_user, @event_message)

This causes the task to be added to the job table but when I run rake jobs:work it logs the following error:

Class#event_message_email failed with NoMethodError: undefined method `event_message_email’ for Class:Class - 6 failed attempts

Calling the mailer method without delay works fine, and I am running it on the default rails server so its not the issue with Thin mentioned in the FAQ. Any idea whats wrong? Thanks.


Reply to this email directly or view it on GitHub: https://github.com/collectiveidea/delayed_job/issues/323