PDA

View Full Version : Problem with uninitialized constant ActionMailer


ambrosia
May 24th, 2007, 12:48 AM
Hi,

My application works fine on ocssolutions, but when I add the lines below in environment.rb, it gives me an error.

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.perform_deliveries = true


The error I get when running dispatch.cgi on the command line is

./dispatch.cgi
./../config/environment.rb:44: uninitialized constant ActionMailer (NameError)
from /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:40:in `run'
from ./../config/environment.rb:13
from ./dispatch.cgi:3:in `require'
from ./dispatch.cgi:3


The output of the command gem list --local includes following lines

actionmailer (1.3.3, 1.2.5)
Service layer for easy email delivery and testing.


What am I missing?

Thanks
Ambrosia

rob
May 24th, 2007, 05:14 PM
Hi,

Please move this:

# My settings for email
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.perform_deliveries = true

to the very end of config/environment.rb

This will fix the problem.

ambrosia
May 24th, 2007, 05:34 PM
I moved the code outside the loop, and put it at the bottom. That solved it.
Thanks!