2

こんにちは、テストを実行するために必要なデータをロードするために Spork gem を使用していますが、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>'

エラーが発生した行は

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

どうすればこれを解決できますか? または、少なくとも、spork が ActionMailer railtie をロードしないようにしますか?

より詳しい情報:

今はメールは気にしない

私はデバイスを使用しています

アプリ/メーラー フォルダーが空です

4

1 に答える 1

0

私は解決策を見つけました: config/application.rb に rails/actionmailer を含めていません。これで問題は解決しました。

于 2013-10-04T10:52:49.577 に答える