Question

Hi i am using Spork gem to load necessary data to run tests but i get the following error while loading Spork

Using RSpec, 
Loading Spork.prefork block...
uninitialized constant ActionMailer (NameError)
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:230:in 'block in constantize'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:229:in 'each'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:229:in 'constantize'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/activesupport-3.2.14/lib/active_support/core_ext/string/inflections.rb:54:in 'constantize'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/devise-3.0.3/app/mailers/devise/mailer.rb:1:in '<top (required)>'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/engine.rb:444:in 'block (2 levels) in eager_load!'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/engine.rb:443:in 'each'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/engine.rb:443:in 'block in eager_load!'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/engine.rb:441:in 'each'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/engine.rb:441:in 'eager_load!'
/home/apellizz/Scrivania/ruby_sites/spec/spec_helper.rb:19:in 'block (2 levels) in <top (required)>'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/application/railties.rb:8:in 'each'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/railties-3.2.14/lib/rails/application/railties.rb:8:in 'all'
/home/apellizz/Scrivania/ruby_sites/spec/spec_helper.rb:19:in 'block in <top (required)>'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork.rb:24:in 'prefork'
/home/apellizz/Scrivania/ruby_sites/spec/spec_helper.rb:5:in '<top (required)>'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/test_framework.rb:138:in 'load'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/test_framework.rb:138:in 'block (2 levels) in preload'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/app_framework.rb:49:in 'preload'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/test_framework.rb:134:in 'block in preload'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork.rb:62:in 'exec_prefork'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/test_framework.rb:120:in 'preload'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:25:in 'preload'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/runner.rb:74:in 'run'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/lib/spork/runner.rb:10:in 'run'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/gems/spork-1.0.0rc3/bin/spork:10:in '<top (required)>'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/bin/spork:23:in 'load'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/bin/spork:23:in '<main>'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/bin/ruby_noexec_wrapper:14:in 'eval'
/home/apellizz/.rvm/gems/ruby-1.9.3-p448@mytests.ruby_sites/bin/ruby_noexec_wrapper:14:in '<main>'

The line that casue the error is

 Rails.application.railties.all { |r| r.eager_load! }

How can i solve this? Or, at least, making spork not loading ActionMailer railtie?

More info:

I dont care about emails now

I am using devise

My app/mailer folder is empty

Was it helpful?

Solution

I found the solution : i haven't included rails/actionmailer in my config/application.rb. This solved the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top