junaidmalik
junaidmalik

Reputation: 89

ExceptionNotifier.notify_exception not working

We are using this gem(https://github.com/smartinez87/exception_notification) with rails 3.2.11. We want to use following method "ExceptionNotifier.notify_exception(e)" from action of controller and from background process as mentioned on the wikie but we are getting following error

undefined method `notify_exception' for ExceptionNotifier:Class

We are installing 3.0.1 version of this gem. gem "exception_notification", "~> 3.0.1"

Our rails version is 3.2.11 and ruby version is ruby 1.9.2p320.

Thanks

Upvotes: 6

Views: 3753

Answers (2)

manish nautiyal
manish nautiyal

Reputation: 2584

In your gem file just write this line

gem 'exception_notification' , '3.0.1'

and after that

bundle install

this works for me :)

Upvotes: 2

deefour
deefour

Reputation: 35350

You're reading an API for notify_exception for a version that has yet to be released as a gem.

You can either point your Gemfile at the git repo

gem "exception_notification", git: "git://github.com/smartinez87/exception_notification.git"

or use the proper API call for 3.0.1

ExceptionNotifier::Notifier.exception_notification(request.env, exception,
:data => {:message => "was doing something wrong"}).deliver

The docs for 3.0.1 are here.

Upvotes: 7

Related Questions