【问题标题】:Why do I have to prepend 'bundle exec' to my command today? [duplicate]为什么我今天必须在命令前添加“bundle exec”? [复制]
【发布时间】:2014-09-29 11:54:34
【问题描述】:

昨天为了运行我的测试,我只需要在命令行上使用rspec

今天做了一个 git pull 和 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】:

    我想在某个时候rspec-support gem 在你的系统中被更新了。也许你做了一个gem update。但是您的应用程序使用的是 3.0.0 版本,这就是该消息的原因。您可以使用bundle update 更新您的捆绑包。通常推荐的避免版本冲突的方法是使用bundle exec

    参考资料:

    【讨论】:

    • 要停止使用 bundle exec rake,您可以运行 bundle clean --force。此命令将更新您的 Gemfile.lock。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    • 2017-03-13
    • 2020-09-03
    • 1970-01-01
    相关资源
    最近更新 更多