2011-02-01 71 views
0

我(錯誤地)更新Rspec到版本2.4,但我的Gemfile在版本2.3。當我嘗試運行Rspec時,我現在收到以下錯誤消息。我相信我需要恢復到2.3 - 任何想法我怎麼能做到這一點?RSpec版本問題 - Rspec不會運行

/Users/woshea/.rvm/gems/[email protected]/gems/bundler-1.0.7/lib/bundler/runtime.rb:27:in `block in setup': You have already activated rspec-core 2.4.0, but your Gemfile requires rspec-core 2.3.1. Consider using bundle exec. (Gem::LoadError) 

回答

1

兩個選項:

  1. 升級你的Gemfile使用2.4,運行gem install,它應該工作。
  2. 如果你想在系統上保留2.4,但仍然在你的項目中使用2.3,那麼運行bundle exec rspec而不是rpsec,這將確保它使用捆綁版本。
+0

我跑了 「捆綁EXEC rspec的」 - 它運行,但現在未運行我以前的測試。有任何想法嗎? – 2011-02-01 15:24:55

+0

我只是想在任何rspec命令前加上`bundle exec`。爲了運行所有的測試,你需要像上面提到的其他回答者那樣實際執行`bundle exec rspec spec`。 – 2011-02-01 15:29:48

0

只能通過捆綁推出的規範

bundle exec rspec spec 

bundle exec rake spec