2010-10-27 122 views
0

Ruby 1.9.2,RoR 3.0.1。當我運行'rspec spec'時,我得到這個錯誤。無法真正理解它。Rspec測試錯誤

[email protected]:~/rubystore$ rspec spec 
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/backward_compatibility.rb:20:in `const_missing': uninitialized constant Admins (NameError) 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.0.1/lib/rspec/expectations/backward_compatibility.rb:6:in `const_missing' 
from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/app/controllers/devise/admins_controller.rb:1:in `<top (required)>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:137:in `each' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:137:in `block in eager_load!' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:135:in `each' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:135:in `eager_load!' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application/railties.rb:11:in `each' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application/railties.rb:11:in `all' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:107:in `eager_load!' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!' 
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing' 
from /home/connor/rubystore/config/environment.rb:5:in `<top (required)>' 
from <internal:lib/rubygems/custom_require>:29:in `require' 
from <internal:lib/rubygems/custom_require>:29:in `require' 
from /home/connor/rubystore/spec/spec_helper.rb:3:in `<top (required)>' 
from <internal:lib/rubygems/custom_require>:29:in `require' 
from <internal:lib/rubygems/custom_require>:29:in `require' 
from /home/connor/rubystore/spec/controllers/products_controller_spec.rb:1:in `<top (required)>' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `block in load_spec_files' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `map' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load_spec_files' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:18:in `run' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run' 
from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun' 

任何人都知道可能發生了什麼?

+0

似乎是你的設計配置的問題。你的應用程序有效你可以運行它? – shingara 2010-10-27 08:10:50

回答

1
from /home/connor/rubystore/config/environment.rb:5:in `<top (required)>' 
from /home/connor/rubystore/spec/spec_helper.rb:3:in `<top (required)>' 
from /home/connor/rubystore/spec/controllers/products_controller_spec.rb:1:in `<top (required)>' 

檢查這些行是否有錯誤。或者可能有東西被包含在你的spec_helper.rb文件中