Search code examples
ruby-on-railsrubybundlerredminegemfile

Redmine keeps asking to run bundle install


I'm performing bundle install of Redmine on a server in China, and I have replaced https://rubygems.org with https://gems.ruby-china.org/ both in gemfile and mirror as suggested like this:

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

And also in my Gemfile, so it looks like this:

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

But after running bundle install which is reinstall actually I'm getting message below:

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)

While I can confirm that 1.8.6 is installed like this:

gem list
...
json (1.8.6, 1.8.3)

And like this:

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

This is the listing of rvm list gemsets:

rvm list gemsets

rvm gemsets

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

I tried deleting .bundle directory, deleting gemfile, purging and reinstalling all gems... Nothing worked. Any suggestions?


Solution

  • This is what eventually fixed my problem, thanks for atombender's answer here: https://github.com/bundler/bundler/issues/5068#issuecomment-259580704

    I've performed:

    bundle install --deployment