uninitialized constant ActionMailer

A word to the wise of rails developers. Hopefully this makes it to Google search, because when I looked it up, there wasn't an answer.

If you're configuring ActionMailer and you try to run the console and get the following messages:

[host]$ script/console
Loading development environment.
uninitialized constant ActionMailer
NameError: uninitialized constant ActionController::Integration::Session::Test
NameError: uninitialized constant ActionController::Base

Make sure your ActionMailer configuration in your config/environment.rb file is after your Rails::Initializer.run do |config| block.

About this article

written on
posted in TechnologyProgrammingOpen-SourceRubyRails Back to Top

About the Author

Andrew Turner is an advocate of open standards and open data. He is actively involved in many organizations developing and supporting open standards, including OpenStreetMap, Open Geospatial Consortium, Open Web Foundation, OSGeo, and the World Wide Web Consortium. He co-founded CrisisCommons, a community of volunteers that, in coordination with government agencies and disaster response groups, build technology tools to help people in need during and after a crisis such as an earthquake, tsunami, tornado, hurricane, flood, or wildfire.