views:

702

answers:

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

$ ls vendor/plugins/
exception_notification

$ cat vendor/plugins/exception_notification/init.rb 
require "action_mailer"
require "exception_notifier"
require "exception_notifiable"
require "exception_notifier_helper"

$ script/console
Loading development environment (Rails 2.3.2)
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support \
  /dependencies.rb:443:in `load_missing_constant':NameError: \
  uninitialized constant ExceptionNotifier
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support \
  /dependencies.rb:443:in `load_missing_constant':NameError: \
  uninitialized constant ApplicationController

>> require "exception_notifier"
MissingSourceFile: no such file to load -- exception_notifier

Probably obvious, but I'm tired today.

A: 

in environment.rb, after the initialize method add:

require 'exception_notification'
Neil Middleton
Thanks, tried it. I get a "no such file to load" error. I thought a plugin merely had to be present and Rails would find it.
Ethan
+2  A: 

This blog post has the solution: How to Install the Exception Notifier Plugin with Ruby on Rails

The ExceptionNotifier.exception_recipients = %w(user@domain) statement in your environment.rb file is probably inside the Rails::Initializer.run do |config| block.

If this is the case, placing it after the end of the block will solve the problem.

Luc Lussier
A: 

You should install this plugin from specific branch:

script/plugin install git://github.com/rails/exception_notification.git -r "2-3-stable"

and configure it exactly as docs are saying.

or when using Rails Templates (in Your template):

plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git', :branch => '2-3-stable'
Martin