Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the version of bundler being used in rails?

When I run the following command, it gives me the available installed versions of bundler:

command :

gem list | grep "bundle"

output:

bundler (1.11.2, 1.10.6, 1.10.4, 1.3.6, 1.3.0, 1.3.0.pre)

The current version of bundler I obtained was 1.11.2 using the following command:

bundler --version

I want to use version 1.3.6 How do I swap the current version of bundler with the available ones?

like image 513
Aditya Naidu Avatar asked Apr 18 '16 20:04

Aditya Naidu


People also ask

How do I change my bundler version?

If you want to upgrade the Bundler version used by your application, you can run bundle update --bundler , and your lockfile will be regenerated using the latest version.

How can I remove default version of bundler?

You have to delete the . gemspec file corresponding to the default gem you want to delete. So first, locate where those files are. Delete the one you don't need.

How do I check my bundler version?

You can check your Ruby version by running ruby --version , and you can check your RubyGems version by running gem --version . If you need to upgrade Ruby, use your ruby version manager's instructions. If you need to upgrade RubyGems, run gem update --system .


1 Answers

Normally during development Bundler is used from it's executable on your system, so I don't believe you can specify a specific version in your Gemfile, for example. (You might try it, though). However, you can install the version you like and force the shell/rubygems to use that version:

$ gem install bundler -v 1.3.6
...
1 gem installed

$ bundle _1.3.6_ -v
Bundler version 1.3.6

To get my machine to use 1.3.6 by default I had to uninstall 1.11.2.

Update: I tried specifying gem 'bundler', '~> 1.3' in one of my projects and it worked, although the CLI for bundler still used the system default version.

like image 132
Xavier Avatar answered Nov 08 '22 18:11

Xavier