This plug-in is very convenient to install and switch ruby versions. It is strongly recommended that the ruby version of the Mac system is outdated. Therefore, you need a tool to manage it and install RVM.
Bash and git are required. The installation of these two tools is very simple.
Run the following command to install RVM:
Bash <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)
Then modify the user configuration file/Users/username/. profile. You can also write it to other global configurations.
Add a line of code:
[[-S "$ HOME/. rvm/scripts/rvm"] &. "$ HOME/. rvm/scripts/rvm" # This loads RVM into a shell session.
Restart Terminal and RVM has been installed. sudo is not required during RVM usage, and gem is not required.
Then you can install ruby, for example:
Rvm install ruby-1.8.7 -- head -- docs
--docs
Is automatically generated after compilation and installation,--head
Is the latest version
Delete a specific version of ruby and delete both the document and gems. Then:
Rvm remove Ruby-1.8.7 -- docs -- gems
Select version:
Rvm use Ruby-1.8.7 -- default
Query the current version:
Rvm info
List versions:
Rvm list
More commands, access http://rvm.beginrescueend.com/rvm/