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:
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