Http://www.ruby-lang.org/en/downloads/ access
After installing Ruby with a third-party tool, you can use macports and rvm to install Ruby on Mac.
After actual operations, I think the rvm method is better.
Now start to use rvm to install Ruby
1. Open the terminal and install git first.
Java code
- Bash-s stable <(curl-s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
,
2. After the rvm is installed, configure the environment variable and enter it in the current user directory.
Java code
- Sudo Vim. bash_profile
Add the. bash_profile File
Java code
- [[-S "$ home/. rvm/scripts/rvm"] & source "$ home/. rvm/scripts/rvm"
You can use rvm after the source operation.
3. start installing Ruby.
View resources.
Java code
- Rvm List known
4. Install Ruby
Java code
- Rvm install ruby -- head
5. Use Ruby
Java code
- Rvm use 1.9.3 -- default
5. Change Source
Java code
- Gem update -- System
- Gem uninstall rubygems-Update
- Gem sources-r http://rubygems.org/
- Gem sources-A http://ruby.taobao.org
6. Install rails
Java code
- Gem install rails-V
-V view Process
Installing Mac OS Ruby using rvm