【发布时间】:2015-10-15 15:11:22
【问题描述】:
我已经按照教程对 SendGrid 进行了一些配置,搜索了很多答案,但在尝试推送到 heroku 时仍然出现此错误:
NameError: undefined local variable or method `auto' for #<SampleApp::Application:0x007f5c8bdaef78>
抛出错误的那一行:
:enable_starttls_auto => true
来自 config/environments.rb 的完整代码:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
host = 'gentle-sands-4285.herokuapp.com'
config.action_mailer.default_url_options = { host: host }
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}
非常感谢任何帮助,希望对通过本教程学习的其他人有所帮助。
【问题讨论】:
标签: ruby-on-rails heroku railstutorial.org sendgrid