2010-10-25 82 views
0
bundle exec /Users/new2/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/bin/rspec  --autotest '/Users/new2/work/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb' 
/Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `require': no such file to load -- b (LoadError) 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `block in requires=' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `map' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `requires=' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:22:in `block in configure' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `each' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `configure' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:17:in `run' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run' 
     from /Users/new2/.rvm/gems/[email protected]/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun' 
^CInterrupt a second time to quit 
^C[sample_app (master)]$ 

这就是上面的错误,一直在环顾四周。我的自动测试文件看起来不错。所有宝石都已安装。检查我是否可以在别处找到问题,但没有成功。有任何想法吗?谢谢自动测试 - 加载错误 - 发布错误

回答

0

除非将代码片段编辑为删除真正缺失的库(这可能会适得其反),您的应用程序中某处存在拼写错误,最有可能位于您的Gemfile中。你有类似的线:

gem 'b' 

在那里的任何地方?如果是这样,如果您从示例代码复制/粘贴,则可能意外地截断了某些内容。

0
source 'http://rubygems.org' 

gem 'rails', '3.0.0' 

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' 

group :development do 
gem 'rspec-rails', '2.0.1' 
end 

group :test do 
    gem 'rspec', '2.0.1' 
    gem 'spork', '0.8.4' 
end 

那是我的Gemfile。

+0

我也试过只运行“自动测试“在另一个演示应用程序目录。它只是导致一个空白的终端。我只在我的'sample_app'目录中得到这个错误。低吼被调用,但它说“SAMPLE_APP:无法运行测试” – New2 2010-10-26 00:04:58

4

我有这个相同的错误。我最初认为这是一个错字(在我的项目中,甚至是在宝石源中偶然产生的) - 但即使将所有内容重新安装到新的rvm gemset也没有解决任何问题。原来,问题是我.rspec文件:

WRONG:

-drb 

RIGHT:

--drb 

双破折号是非常必要的;)