为什么今天我必须在命令前加上“ bundle exec”? [重复]

问题描述 投票:2回答:1

昨天运行测试,我只需要在命令行上输入rspec

今天进行了git pull and blah blah。我收到此错误

gems/bundler-1.6.2/lib/bundler/runtime.rb:34:in 'block in setup': You have already activated rspec-support 3.0.3, but your Gemfile requires rspec-support 3.0.0. Prepending 'bundle exec' to your command may solve this. (Gem::LoadError)

是,bundle exec rspec可以运行并运行我的测试。 “引擎盖下”发生了什么?

ruby-on-rails ruby rspec bundler
1个回答
3
投票

我想在某些时候rspec-support gem在您的系统中已更新。也许您做了一个gem update。但是,您的应用使用的是3.0.0版,这是出现此消息的原因。您可以使用bundle update更新套件。通常,建议避免版本冲突的方法是使用bundle exec

参考:

© www.soinside.com 2019 - 2024. All rights reserved.