How to 'Bundle Install' When Your Gemfile Requires an Older Version of Bundler

How to `bundle install` when your Gemfile requires an older version of bundler?

First you need to install the appropriate version of bundler:

% gem install bundler -v '~> 1.0.0'
Successfully installed bundler-1.0.22

Then force rubygems to use the version you want (see this post):

% bundle _1.0.22_ install

Warning: the running version of Bundler is older than the version that created the lockfile error

Just run gem install bundler:2.1.4, don't worry about the older version that comes with ruby, it should not be used.

how to get bundler to use an older bundler gem version?

You can use bundle _version_ install to install gems using a specific version.

Here's an example:

bundle _1.0.21_ install

or

bundle _1.0.21_ -v
# Bundler version 1.0.2

Reference: http://makandracards.com/makandra/9741-run-specific-version-of-bundler

Bundler : Is there a way to set the version?

You need to delete manually the directory on your problematic ruby version: for example if there is a bundler problem with the 2.5.1 ruby version, go to this path:

/Users/YOUR_USER/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/

and delete the bundler directory.

If bundler is in the default specification you also need to remove the bundler associated file on this path:

/Users/YOUR_USER/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/specifications/default

Then you can re-install a specific version of bundler using @Unixmonkey answer

bundler version issue in rails 4?

There can be multiple versions of the same gem installed in your gemset. Run this:

gem install bundler:2.0.0.pre.3

and then run this:

gem info bundler

you will find two versions of the gem installed. By default, it will run bundle with the latest version but as your gems are not compatible with it you can run bundle with a different version of the gem. To do that you need to run:

bundle _version_

in your case it will be:

bundle _2.0.0.pre.3_

You can also remove the other versions of the bundler gem and just keep the one that is compatible. To remove a specific version you could do:

gem uninstall bundler:2.3.12


Related Topics



Leave a reply



Submit