Rails:运行’bundle’命令时出错

我正在运行bundle install --local并收到以下错误:

Your bundle is locked to rake (11.2.2), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of rake (11.2.2) has removed it. You'll need to update your bundle to a different version of rake (11.2.2) that hasn't been removed in order to install.

无法破译需要做什么。 任何帮助将受到高度赞赏。

尝试运行这些命令

 gem install rubygems-bundler gem regenerate_binstubs 

我在使用Jenkins时遇到了这个问题,所以这里有什么帮助我:

首先通过控制台到您的工作目录:

 cd /var/lib/jenkins/workspace/ 

如果您不确定Jenkins存储项目的位置,请在bash脚本中使用pwd命令。

在此目录中,找到您的Gemfile.lock并将其删除

 rm Gemfile.lock 

然后尝试像通常从控制台那样运行bundle

 bundle install 

并看到您的捆绑工作。 希望它能帮助某人解决问题。