2012-08-10 74 views
0

創建測試使用RSpec工作正常,但如果我想執行這些測試,我得到以下錯誤」:NoMethodError:未定義的方法`active_record當試圖運行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 

...

回答

0

找到我的答案here。我沒有在我的項目中使用活動記錄。

相關問題