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.
./script/../config/../config/environment.rb:41:NameError:
uninitialized constant ActionMailer
/home/highearth/.gems/gems/actionpack-1.12.1/lib/action_controller/integration.rb:15:
NameError: uninitialized constant ActionController::Integration::Session::Test
./script/../config/../config/../app/controllers/application.rb:3:
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.