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?