2014-02-20 118 views
1

我的Gemfile當前規定如下:「沒有這樣的文件來加載 - rspec的/預期(LoadError)」

gem "rspec-expectations", "2.7.0" 

當我嘗試運行黃瓜,我得到如下:

no such file to load -- rspec/expectations (LoadError) 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require' 
/Library/Ruby/Gems/1.8/gems/rspec-2.7.0/lib/rspec.rb:2 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require' 
/Users/rthomas/dev/companyname/ci/behavior_testing/features/support/env.rb:4 

.... 

的的Gemfile我與指定v 2.7.0工作,所以我嘗試更新的是,重新運行黃瓜,和我有以下幾點:

can't activate rspec-expectations (~> 2.7.0, runtime) for ["rspec-2.7.0"], already activated rspec-expectations-2.14.5 for [] (Gem::LoadError) 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:230:in `activate' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:246:in `activate' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:245:in `each' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:245:in `activate' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:35:in `require' 
/Users/rthomas/dev/companyname/ci/behavior_testing/features/support/env.rb:4 

.... 

顯然,當我卸載2.7.0並使用最新的RSpec版本時,我收到了RubyGem版本錯誤。

我發現this post並試圖更新我的rspec-rails gem版本,但沒有喜悅。

我需要在給定的Gemfile約束下工作,所以有什麼方法可以在使用2.7版本時修復初始錯誤(無需加載此類文件 - rspec/expectations(LoadError))。 0?

回答

1

找到this article,其中談到了「diff-lcs」寶石。 OP安裝了兩個不同的版本,而較新的版本引起衝突。我檢查了我的Gemlist,發現我有正確的(1.1.3)和更新的(1.2.5),所以我只卸載了較新的版本,並且能夠運行我的黃瓜測試。

相關問題