NameError: uninitialized constant Mail::Parsers::ContentTransferEncodingParser

久未见 提交于 2019-12-06 04:22:58

问题


Sometimes when I send mass email on heroku some of them fail with the following error: NameError: uninitialized constant Mail::Parsers::ContentTransferEncodingParser

I have no idea why is that but I think that maybe this maybe caused by using attachments.inline in mailer. Any ideas what may cause this problem?


回答1:


I create initializer with following line:

Mail.eager_autoload! if Rails.env.production? && defined?(Mail)

and that fixes the problem.



来源:https://stackoverflow.com/questions/33615873/nameerror-uninitialized-constant-mailparserscontenttransferencodingparser

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