0

rspec を使用したテストの作成は正常に機能しますが、それらのテストを実行したい場合、次のエラーが発生します。

NoMethodError: undefined method `active_record' for #<Rails::Application::Configuration:0x3011c001>
    method_missing at org/jruby/RubyBasicObject.java:1687
    method_missing at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/railtie/configuration.rb:85
            (root) at C:/Workspace/OE_11/project_name/config/environments/test.rb:33
       module_eval at org/jruby/RubyModule.java:2277
         configure at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/railtie/configurable.rb:24
            (root) at C:/Workspace/OE_11/project_name/config/environments/test.rb:1
           require at org/jruby/RubyKernel.java:1042
           require at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251
   load_dependency at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236
           require at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251
            Engine at C:/Workspace/OE_11/project_name/config/environments/test.rb:571
     instance_exec at org/jruby/RubyBasicObject.java:1757
               run at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/initializable.rb:30
  run_initializers at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/initializable.rb:55
              each at org/jruby/RubyArray.java:1615
  run_initializers at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/initializable.rb:54
       initialize! at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/application.rb:136
          __send__ at org/jruby/RubyBasicObject.java:1698
              send at org/jruby/RubyKernel.java:2097
    method_missing at c:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.7/lib/rails/railtie/configurable.rb:30

...

4

1 に答える 1

0

ここで私の答えを見つけました。プロジェクトでアクティブ レコードを使用していません。

于 2012-08-10T08:32:13.517 に答える