SUPPORT THE SITE WITH A CLICK

Subscribe Rss:

SUPPORT THE SITE WITH A CLICK

Friday, June 6, 2008

`load_missing_constant': uninitialized constant ExceptionNotifier (NameError)

I have got this error while i have installed exception notifier plugin in rail 2.1.0.
After installing the plugin at first i have added include ExceptionNotifiable
in my application.rb file .then i have added
ExceptionNotifier.sender_address = %w(webmaster@ssoft.com)
ExceptionNotifier.exception_recipients = %w(u@ssoft.com)
in environment.rb.
Finally i have restarted the server there i got this error.

/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:278:in `load_missing_constant': uninitialized constant ExceptionNotifier (NameError)



After searching in google i have noticed that i have misplaced the Exceptionnotifier in
application.rb file.

Things which i did to solve this error:

1.application.rb



class ApplicationController < ActionController::Base
include ExceptionNotifiable
local_addresses.clear
-----------------------
-----------------
end

2.config/environment.rb



Rails::Initializer.run do |config|
-----------
----------
Add these lines
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "localhost",
:port => 25,
:domain => "yourdomainname",
:authentication => :login,
:user_name => "user",
:password => "secret"
}

end
Add these lines
ExceptionNotifier.sender_address = %w(webmaster@ssoft.com)
ExceptionNotifier.exception_recipients = %w(t@ssoft.com)


Since my application is running in development mode i configured in my development.rb file

/config/environments/development.rb



config.cache_classes = false


config.whiny_nils = true


config.action_controller.consider_all_requests_local = false
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
config.action_view.cache_template_extensions = false


config.action_mailer.raise_delivery_errors = true


Before doing this check you are having actionmailer & sendmail if u are a Linux user.This application has been tested in Ubuntu 7.10 with rails 2.1.0 & ruby 1.8.6