Redmine 一直要求 运行 bundle install

Redmine keeps asking to run bundle install

我正在中国的服务器上执行 Redmine 的捆绑安装,我已经按照建议在 gemfile 和镜像中替换了 https://rubygems.org with https://gems.ruby-china.org/,如下所示:

gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

也在我的 Gemfile 中,所以它看起来像这样:

#source 'https://rubygems.org'
source 'https://gems.ruby-china.org/'

但是在 运行 bundle install 实际上是重新安装之后,我收到以下消息:

Your bundle is locked to json (1.8.6), 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 json (1.8.6) has removed it. You'll need to update your bundle to a different version of json (1.8.6) that hasn't been removed in order to install. (Bundler::GemNotFound)

虽然我可以确认 1.8.6 安装如下:

gem list
...
json (1.8.6, 1.8.3)

像这样:

bundle show json
/home/redminedev/.rvm/gems/ruby-2.3.3/gems/json-1.8.6

这是 rvm 列表 gemset 的列表:

rvm list gemsets

rvm gemsets

=> ruby-2.3.3 [ x86_64 ]
   ruby-2.3.3@global [ x86_64 ]

我尝试删除 .bundle 目录、删除 gemfile、清除并重新安装所有 gems... 没有任何效果。有什么建议吗?

这最终解决了我的问题,感谢 atombender 在这里的回答: https://github.com/bundler/bundler/issues/5068#issuecomment-259580704

我做过:

bundle install --deployment