2010-10-25 54 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 

雙破折號是非常必要的;)