I am using delayed job version 2.1.4 with action mailer 3.0.8 to send my emails in background.
UserMailer.delay.newsletter(email)
It works with me fine in development and production Rails console.
But when it is called from my live production passenger server, it creates DJ but when this DJ runs, it throws
{undefined method `newsletter' for #<Class:0xc08afa0>
I think the problem
Any help?
The problem is with rails/passenger in production mode with class methods
So, I made a work around solution… I will try to call instance method and avoid to call class method.
Lets see an example; assuming I need to call the following method in background..
Then, I created a new class DelayClassMethod
and can run the method in background now by
So, I am running an instance method now in background which will run the class method.
Another example..
Assume I want to run
Then it can be run by