bundle exec /Users/new2/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/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/ruby-1.9.2-p0@rails3tut/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/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `block in requires='
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `map'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `requires='
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:22:in `block in configure'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `each'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `configure'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:17:in `run'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/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 :(得分:4)
我有同样的错误。我最初认为它是一个拼写错误(在我的项目中,甚至在宝石源中偶然制作) - 但即使重新安装到一个新的rvm gemset也没有修复任何东西。结果问题出在我的.rspec文件中:
WRONG:
-drb
RIGHT:
--drb
双点划线是非常必要的;)
答案 1 :(得分:0)
除非编辑代码段以删除真正丢失的库(这会适得其反),否则您的应用中会出现一个拼写错误,很可能是在您的Gemfile中。你有类似的行:
gem 'b'
那里的任何地方?如果是这样,如果您从示例代码中复制/粘贴,则可能会意外截断某些内容。
答案 2 :(得分: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。