2009-07-30 151 views
1

试图让Rails例外通知程序插件工作。我已经安装了它在我的应用程序...例外通知程序插件不发送电子邮件

script/plugin install git://github.com/rails/exception_notification.git 

environment.rbRails::Initializer通话结束将这个......

ExceptionNotifier.exception_recipients = %w([email protected]) 
ExceptionNotifier.sender_address = %("Error" <[email protected]>) 
ExceptionNotifier.email_prefix = "[Error] " 

添加这些到development.rb ...

config.action_controller.consider_all_requests_local = true 
ActionMailer::Base.raise_delivery_errors = true 

加入application_controller.rb

include ExceptionNotifiable 
local_addresses.clear 

,并将此我进行测试操作之一......

raise RuntimeError, "Generating an error" 

当我打的异常引发的行动,但没有电子邮件熄灭。看着开发日志。没有电子邮件活动的迹象。

我确认我可以在开发中发送测试电子邮件,所以电子邮件发送配置正确。

回答

4

ExceptionNotifier不会发送错误电子邮件,因为它将您的请求视为本地。尝试更改此配置设置:

config.action_controller.consider_all_requests_local = false