Gem not initializing when running job from worker?

回眸只為那壹抹淺笑 提交于 2019-12-12 01:06:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!