我如何“激活”不同版本的特定宝石? [英] How do I "activate" a different version of a particular gem?
问题描述
我想在rails 2.3.10之间切换,作为我的操作系统的activegem,这样我就可以在命令行调用它了。
可能做到这一点?我没有使用rvm。也许是时候开始了。
我试过 gem install rails --version = 2.3.10
,但这只是确保gem版本已安装,它不会将它放在 / usr / bin / rails
中。
< (我已经为我的应用程序使用了打包程序 - 但直到现在,在操作系统级别上还不需要精确控制宝石)
rails --version#=>> ;最新版本
rails _2.3.10_ --version#=> Rails 2.3.10
这个模式( gem-binary _gem-version _
)适用于任何gem二进制文件。
希望它有帮助。
I want to switch between rails 2.3.10 as the "active" gem for my OS, so that I can invoke it at the command line.
Is it possible to do this? I'm not using rvm. Maybe it's time to start.
I tried gem install rails --version=2.3.10
, but that just makes sure that version of the gem is installed, it doesn't put it in /usr/bin/rails
.
(I do already use bundler for my apps -- but haven't needed any precise control over gems at the OS level until now)
If your problem is to run binaries of a certain version, then:
rails --version # => the latest version
rails _2.3.10_ --version # => Rails 2.3.10
This pattern (gem-binary _gem-version_
) works for any gem binary.
Hope it helps.
这篇关于我如何“激活”不同版本的特定宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!