Forum: Ruby on Rails Nil while creating message in ActionMailer

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
32f2a6c1cb37565ce0997f0592330aad?d=identicon&s=25 Nick Allen (Guest)
on 2007-03-19 00:34
I have created an ActionMailer and am able to use it successfully in
development.  As soon as I move it to the production environment, I am
getting an exception.  It seems like it must be some kind of
configuration issue.  Does any have an idea based on the stack trace?

>> RegistrationMailer.create_confirm(reg)
TypeError: can't convert nil into String
        from (irb):3
32f2a6c1cb37565ce0997f0592330aad?d=identicon&s=25 Nick Allen (Guest)
on 2007-03-20 01:43
In my production environment the template path was not being set
correctly.  It was not looking in my apps/views directory for the mail
template. I had to manually set the template root...

ActionMailer::Base.template_root = "#{RAILS_ROOT}/app/views"

Why did this work in development, but not in production?
32f2a6c1cb37565ce0997f0592330aad?d=identicon&s=25 Nick Allen (Guest)
on 2007-03-21 00:40
> ActionMailer::Base.template_root = "#{RAILS_ROOT}/app/views"

This still doesnt seem to be resolved if I manually set the
template_root.  Where does the template_root normally get set from?  Why
is the setting for template_root in development different than
This topic is locked and can not be replied to.