Forum: Ruby on Rails ExeceptionNotifier troubles

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D855690573f11a2eba3951203c603b7e?d=identicon&s=25 sergio (Guest)
on 2005-11-13 21:38
(Received via mailing list)
I am having a hard time installing the ExeceptionNotifier plugin. The
README says:

"specify the email recipients in your environment:"
ExceptionNotifier.exception_recipients = %w(myown@email.com)"

I tried putting the line above in the environment.rb or the
/environments/development.rb and both prevent me from booting WEBrick.
here is the error:

=> Booting WEBrick...
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:200:in
`const_missing': uninitialized constant ExceptionNotifier (NameError)

any clues?

Thanks,
Serge
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 jamis (Guest)
on 2005-11-13 21:59
(Received via mailing list)
On Nov 13, 2005, at 1:38 PM, sergio@spacedoghouse.com wrote:

> => Booting WEBrick...
> /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/
> dependencies.rb:200:in
> `const_missing': uninitialized constant ExceptionNotifier (NameError)
>
> any clues?

The problem is that the dev/test/prod environments are loaded before
plugins are loaded. You need to put the line in environment.rb
itself. If you want to send to different addresses based on the
current environment, you can do a case statement:

   ExceptionNotifier.exception_recipients = case RAILS_ENV
     when "development" then %w(devperson@email.com)
     when "production" then %w(prodperson@email.com other@email.com)
     when "test" then []
   end

- Jamis
This topic is locked and can not be replied to.