How to install the Ruby Runtime environment on Mac OS X

Source: Internet
Author: User
Tags administrator password

This page focuses on how to quickly install a Ruby development environment with a reliable path.

System Requirements

First determine the operating system environment, it is not recommended to engage in Windows, so you need to use:

    • Mac OS X

The following code area, with a $ first representation, needs to be performed under the Console (terminal) (not including the $ symbol)

Step 1-Install RVM (Ruby version manger ruby Release Management)

What is RVM do not explain here, you will slowly understand the back.

\curl -L https://get.rvm.io | bash -s stable --ruby

You may be asked for a sudo administrator password, and you homebrew can install the RVM successfully after a period of time by installing the dependent packages automatically.

Then, load into the RVM environment (new open termal will not do so, will automatically reload)

SOURCE ~/.RVM/SCRIPTS/RVM

Check to see if the installation is correct

(Stable[https://rvm.io/]
Step 2-Install the Ruby environment with RVM

List known versions of Ruby

   $ RVM list known

You can select an existing RVM version to install it (you just want the latest

$rvm install current && rvm use current
Also continue to wait for a lengthy download, the compilation process, after completion, Ruby, Ruby Gems is installed.

Also attached:

Query the ruby that is already installed

  $ RVM List

Uninstalling an installed version

$ RVM Remove 2.0.0

Step 3-Set up Ruby version

This time you can test whether it is correct

(2013-06-27 revision 41674[x86_64-darwin13.0.0] $ gem-v 2.1.6

This could be because Ruby's default source uses cocoapods.org, and domestic access to the site can sometimes be problematic, and a solution on the web is to replace the Ruby-china , and replace it in the following way:

1. Remove the existing Ruby default source

$gem sources--remove https://rubygems.org/

2. Use the new source

$gem sources-a https://gems.ruby-china.org

3. Verify that the Xinyuan is replaced successfully

$gem Sources-l (This is L)

Normal output results:

Current SOURCES

https://gems.ruby-china.org            

The ruby environment has been successfully installed on Mac OS X and can then be developed and used accordingly.

How to install the Ruby Runtime environment on Mac OS X

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.