Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 ActionMailer未在ExceptionNotification中使用正确的smtp\u设置_Ruby On Rails 3_Actionmailer_Exception Notification - Fatal编程技术网

Ruby on rails 3 ActionMailer未在ExceptionNotification中使用正确的smtp\u设置

Ruby on rails 3 ActionMailer未在ExceptionNotification中使用正确的smtp\u设置,ruby-on-rails-3,actionmailer,exception-notification,Ruby On Rails 3,Actionmailer,Exception Notification,出于某种原因,似乎没有应用我的smtp设置。我在application.rb中设置了它们 # application.rb config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain

出于某种原因,似乎没有应用我的smtp设置。我在application.rb中设置了它们

# application.rb     
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => "blah.com",
  :user_name            => "user@blah.com",
  :password             => "pwd",
  :authentication       => 'plain',
  :enable_starttls_auto => true
}
但是当我尝试发送邮件(使用ExceptionNotification)时,我遇到了一个连接失败的错误,一些人向我展示了邮件gem使用的设置是错误的

{:address=>"localhost", :port=>25, :domain=>"localhost.localdomain", :user_name=>nil, :password=>nil, :authentication=>nil, :enable_starttls_auto=>true, :openssl_verify_mode=>nil, :ssl=>nil, :tls=>nil}

我以前从未在rails(3.2.7)中看到过这个问题,所以我怀疑这是我正在做的事情,但是我在修改设置时遇到了其他问题,我找不到任何东西。有人有什么想法吗?

像往常一样,我花了几个小时试图找出问题所在,但一旦我发布了,我就知道发生了什么:s

和往常一样,我在开发模式下禁用了ExceptionNotifier,但是gem仍然包含在内,所以它仍然尝试做所有事情。显然,邮件配置是没有完成的事情之一

解决方案:在开发模式下启用或在产品中运行