简体   繁体   中英

How can I install ruby 2.2.1 if I am on 2.2.2?

如果我目前在2.2.2上,如何安装ruby 2.2.1 ...我需要回退一个版本,因为ruby 2.2.2似乎在终端中加载我的项目时遇到了一些问题。

RVM is a version management system that does exactly this.

https://rvm.io/

Once you install see the faqs

https://rvm.io/rvm/basics

An option for Ruby version management is rbenv . I prefer it to RVM because it's not as intrusive (it doesn't need to be loaded into your shell, it doesn't override shell commands, it doesn't manage gemsets, etc.).


In your case, to install an older Ruby version, you can do the following, once rbenv is installed:

Check for available Ruby versions:

rbenv install -l

The above should show a list of all versions available (in your scenario, 2.2.1 should be an available option). Then once you have picked out a version you wish to install, the following command can be run next:

rbenv install 2.2.1

Finally, To switch between ruby versions you can run:

rbenv local 2.2.1

Or to set Ruby 2.2.1 to be default globally:

rbenv global 2.2.1

More info, such as installation instructions, can be found in the README

Hope that was helpful to you!

Ruby版本管理的另一个选择是chruby

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM