6

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

junaidmalik
  • 89
  • 1
  • 4

2 Answers2

7

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.

deefour
  • 34,974
  • 7
  • 97
  • 90
  • Ah, yes good to read the screaming text at the top of the github repo: THIS README IS FOR THE MASTER BRANCH AND REFLECTS THE WORK CURRENTLY EXISTING ON THE MASTER BRANCH. IF YOU ARE LOOKING FOR DOCUMENTATION OF AN ALREADY RELEASED VERSION OF EXCEPTION NOTIFICATION, PLEASE CONSULT THAT ON THE README OF THE TAG FOR THAT VERSION AND NOT THIS ONE. – Danny Jun 10 '13 at 19:36
  • 2
    To be fair to OP, it wasn't until almost a week after this Question was created that anything resembling such a helpful not was added to the README. https://github.com/smartinez87/exception_notification/commits/master/README.md Seems you're far from the only one who ran into trouble :-) – deefour Jun 10 '13 at 21:54
2

In your gem file just write this line

gem 'exception_notification' , '3.0.1'

and after that

bundle install

this works for me :)

manish nautiyal
  • 2,556
  • 3
  • 27
  • 34