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
Best Practices For Reusing Code Between Controllers in Ruby on Rails
How to Display Ruby on Rails Form Validation Error Messages One At a Time
Heroku Not Sending Email With Gmail Smtp
Eoferror: End of File Reached Issue With Net::Http
Why Isn't Current Directory on My Ruby Path
Ruby Gsub Doesn't Escape Single-Quotes
How to Use Gem to Install Rails on Ubuntu
Recommended Development Web Server for Ruby on Rails 3
Calculating the Number of Weeks in a Year with Ruby
Is the Server Running on Host "Localhost" (::1) and Accepting Tcp/Ip Connections on Port 5432
Serving Static Files With Sinatra
Ruby - Net/Http - Following Redirects
Class ≪≪ Self VS Self.Method With Ruby: What's Better
Can't Install Pg Gem on Windows
Can Ruby Print Out Time Difference (Duration) Readily