我向heroku部署了rails 5应用程序。我用邮件发送电子邮件,它在发展中发挥了良好的作用。在生产中,当我尝试注册一个用户时,我会得到以下错误:

production.rb:
config.action_mailer.delivery_method = :mailgun
config.action_mailer.default_url_options = { :host => 'http://myappname.herokuapp.com', :protocol => 'https'}
config.action_mailer.mailgun_settings = {
domain: ENV['MAILGUN_DOMAIN'],
api_key: ENV['MAILGUN_KEY']
}MAILGUN_DOMAIN和MAILGUN_KEY作为环境变量存储在我的PC机上。有什么事情我做得不对吗?谢谢!
安装figaro之后:
application.yml
development:
MAILGUN_DOMAIN: ******************************
MAILGUN_KEY: **************************
production:
MAILGUN_DOMAIN: ******************************
MAILGUN_KEY: **************************
I still get the same error!!发布于 2018-01-03 09:53:34
它看起来与按关于邮递员的这一期安装的邮件创业板的版本有关。
解决方法是将邮件创业板显式地添加到Gemfile中,并将版本锁定为2.6.5。
gem 'mail', '2.6.5'然后,您需要运行bundle update mail --conservative才能获得新版本。
https://stackoverflow.com/questions/44551733
复制相似问题