Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception Notification Gem and Rails 3

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

In my Gemfile I have

gem "exception_notification", :git => "http://github.com/rails/exception_notification.git", :branch => "master"

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.

like image 366
Darren Hinderer Avatar asked Aug 19 '10 16:08

Darren Hinderer


4 Answers

All previous answers are outdated, you can now simply add this to your gemfile:

gem 'exception_notification', :require => 'exception_notifier'

And edit your production.rb config file as indicated in the readme:

config.middleware.use ExceptionNotifier,
  :email_prefix => "[Exception] ",
  :sender_address => %{"Exception Notifier" <[email protected]>},
  :exception_recipients => %w{[email protected]}
like image 134
Jan M Avatar answered Nov 14 '22 02:11

Jan M


Latest version of official gem works with Rails 3, you can find it here: https://github.com/smartinez87/exception_notification.

Next gem release will make the :require => 'exception_notifier' option unnecessary.

like image 21
Sebastian Martinez Avatar answered Nov 14 '22 03:11

Sebastian Martinez


Ok, its working now for me:

# Gemfile
gem "exception_notification", :git => "git://github.com/rails/exception_notification", :require => 'exception_notifier'

# application.rb, inside the config block
config.middleware.use ::ExceptionNotifier,
  :email_prefix => "ApplicationName-Errors: ",
  :sender_address => %w{[email protected]},
  :exception_recipients => %w{[email protected]}
like image 13
BvuRVKyUVlViVIc7 Avatar answered Nov 14 '22 03:11

BvuRVKyUVlViVIc7


Keep it simple silly

In gemfile

gem 'exception_notification', :require => 'exception_notifier'

In application.rb file

  config.middleware.use ExceptionNotifier,
 :email_prefix => "[ERROR] ",
 :sender_address => %{"Exception Notifier" <[email protected]>},
 :exception_recipients => %w{[email protected]}

Your are Done.. :*

like image 10
Saqib R. Avatar answered Nov 14 '22 03:11

Saqib R.