RVM installation and Use summary notes _ruby topics

Source: Internet
Author: User

To install the RVM command:

Copy Code code as follows:

Bash < < (Curl Http://rvm.beginrescueend.com/releases/rvm-install-head)

Then modify the user profile/users/username/.profile, and you can also write to other global configurations.

Add one line of code:

Copy Code code as follows:

[[s] $HOME/.RVM/SCRIPTS/RVM]] &&. "$HOME/.RVM/SCRIPTS/RVM" # This loads RVM to a shell session.

If "$HOME/.RVM/SCRIPTS/RVM" exists, the execution

Reboot the TERMINAL,RVM and install it. There is no need to use Sudo,gem in the process of RVM.

You can then install Ruby, for example:

Copy Code code as follows:

RVM Install ruby-1.8.7--head--docs
--docs is automatically generated after compiling the installation,--head is the latest version

Delete a version of Ruby and delete both the document and the gems:
Copy Code code as follows:

RVM Remove ruby-1.8.7--docs--gems

Select version:

Copy Code code as follows:

RVM Use ruby-1.8.7--default

Query Current version:
Copy Code code as follows:

RVM Info

List version:

Copy Code code as follows:

RVM List

RVM In addition to managing different versions of Ruby, you can create different gem collections (gemsets) for each Ruby version so that different Ruby applications can use their own gem collections independently. For example, in the case of using ruby-1.9.2-p290, I need to build two rails projects, one using rails-3.0, one using rails-3.1.0, we can create two gemset, and install the corresponding rails version and other gems under each gemset respectively:
Copy Code code as follows:

RVM Gemset Create rails-3.0 #创建名为rails-3.0 Gemset
RVM 1.9.2-p290@rails-3.0 #使用ruby -1.9.2-p290 and use rails-3.0 Gemset
Gem Install RAILS-V 3.0 #在rails -3.0 Gemset installs Rails version 3.0
RVM gemset Create rails-3.1.0 #创建名为rails -3.1.0 gemset
RVM 1.9.2-p290@rails-3.1.0 #使用ruby -1.9.2-p290 and use rails-3.1.0 Gemset
Gem install rails-v 3.1.0 #在rails -3.0 Gemset installs Rails 3.1.0 version

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

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.