Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force rubygems or shell to use a certain version of a gem's executable?

For example, I can install v1.3.6 of bundler on my machine, but the shell will still use v1.11.2:

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

$ bundle -v
Bundler version 1.11.2

To actually use v1.3.6, I have to either explicitely say so every time or uninstall v1.11.2:

$ bundle _1.3.6_ -v
Bundler version 1.3.6

$ gem uninstall bundler -v 1.11.2
...

$ bundle -v
Bundler version 1.3.6

How I can I keep earlier versions of Bundler installed (like 1.11.2) but change the default to another version?

like image 679
Xavier Avatar asked Apr 18 '16 20:04

Xavier


1 Answers

Not sure your limitations, but why don't you alias the bundler?

in .bash_rc for one user, or in /etc/bashrc for all users

alias bundle='bundle _1.3.6_'

like image 59
SaintHax Avatar answered Nov 15 '22 05:11

SaintHax