异常通知宝石和轨道3 [英] Exception Notification Gem and Rails 3
问题描述
我正在尝试使其运行,但是当我启动我的服务器时,我看到未初始化的常量ExceptionNotifier。
I'm trying to get this up and running, but I see "uninitialized constant ExceptionNotifier" whenever I start my server.
http://github.com/rails/exception_notification
在我的Gemfile中我有
In my Gemfile I have
gemexception_notification,:git => http://github.com/rails/exception_notification.git ,:branch =>master
gem "exception_notification", :git => "http://github.com/rails/exception_notification.git", :branch => "master"
我已经尝试将config / application.rb,config / environment.rb和config.ru中的github自述文件中显示的配置。我的应用程序名称替换了Whatever。
I've tried putting the configuration as shown in the github readme inside of config/application.rb, config/environment.rb, and config.ru. I replaced "Whatever" with my application name.
推荐答案
所有以前的答案都已经过时了,现在可以将其简单添加到您的gemfile :
All previous answers are outdated, you can now simply add this to your gemfile:
gem 'exception_notification', :require => 'exception_notifier'
并编辑您的production.rb配置文件,如readme所示:
And edit your production.rb config file as indicated in the readme:
config.middleware.use ExceptionNotifier,
:email_prefix => "[Exception] ",
:sender_address => %{"Exception Notifier" <support@example.com>},
:exception_recipients => %w{you@me.com}
这篇关于异常通知宝石和轨道3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!