RVM Installation and Use Summary notes, rvm summary notes

Source: Internet
Author: User

RVM Installation and Use Summary notes, rvm summary notes

Run the following command to install RVM:
Copy codeThe Code is as follows:
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:
Copy codeThe Code is as follows:
[[-S "$ HOME/. rvm/scripts/rvm"] &. "$ HOME/. rvm/scripts/rvm" # This loads RVM into a shell session.

If "$ HOME/. rvm/scripts/rvm" exists, run

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:
Copy codeThe Code is as follows:
Rvm install ruby-1.8.7 -- head -- docs
-- Docs automatically generates documents after compilation and installation, and -- head is the latest version.

Delete a specific version of ruby and delete both the document and gems. Then:
Copy codeThe Code is as follows:
Rvm remove ruby-1.8.7 -- docs -- gems

Select version:
Copy codeThe Code is as follows:
Rvm use ruby-1.8.7 -- default

Query the current version:
Copy codeThe Code is as follows:
Rvm info

List versions:
Copy codeThe Code is as follows:
Rvm list

In addition to managing different ruby versions, rvm can also create different gemsets for each ruby version so that different Ruby applications can use their own Gem sets independently. For example, when using a ruby-1.9.2-p290, I need to build two rails projects, one using rails-3.0 and the other using rails-3.1.0, we can create two gemsets, install the corresponding rails version and other required gems in each gemset:
Copy codeThe Code is as follows:
Rvm gemset create rails-3.0 # create a gemset named rails-3.0
Rvm 1.9.2-p290@rails-3.0 # Use ruby-1.9.2-p290 and use rails-3.0 gemset
Gem install rails-v 3.0 # install rails 3.0 under rails-3.0 gemset
Rvm gemset create rails-3.1.0 # create a gemset named rails-3.1.0
Rvm 1.9.2-p290@rails-3.1.0 # Use ruby-1.9.2-p290 and use rails-3.1.0 gemset
Gem install rails-v 3.1.0 # install rails 3.1.0 under rails-3.0 gemset

More commands, access http://rvm.beginrescueend.com/rvm/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.