问题
I am using the Mandrill api gem to send scheduled emails with the delayed jobs gem.
When the delayed job is executed by the worker the job is crashing at the line which creates the mandrill message with the following error:
DailyMailJob failed with NameError: uninitialized constant Mandrill::API
If I execute this job from the rails console it runs fine.
Why does this job not work when running from the worker?
回答1:
I managed to fix the issue by installing the gem into the computer rather than just into the app.
The command I used to do this was:
gem install mandrill=api
来源:https://stackoverflow.com/questions/16869292/gem-not-initializing-when-running-job-from-worker