Mac环境下安装Ruby

使用rvm来安装ruby

step1

1
$ curl -L get.rvm.io | bash -s stable  

step2

1
2
3
$ source ~/.bashrc $ source ~/.bash_profile$ rvm -v  
$ source ~/.bash_profile
$ rvm -v

step3

1
$ rvm list known  

step4

1
$ rvm install 2.2.0  

如果Step4失败,可以进行如下尝试

1
2
3
4
5
6
sudo chown -R $(whoami):admin /usr/local
cd /usr/local
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
brew update
sudo chown root:wheel /usr/local
rvm install 2.2.0