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

江枫思渺然 提交于 2019-12-07 14:23:13

问题


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?


回答1:


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_'



来源:https://stackoverflow.com/questions/36703958/how-to-force-rubygems-or-shell-to-use-a-certain-version-of-a-gems-executable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!