rvm: ruby version manager

Mac下升级Ruby

1. 安装rvm(ruby版本管理器)

1
2
ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
  • 安装 rvm
1
curl -L get.rvm.io | bash -s stable

2. 配置资源

1
2
source ~/.bashrc
source ~/.bash_profile

3. 查看版本

1
2
rvm -v
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

4. 查看可安装的ruby版本

1
rvm list known

5. 安装Homebrew

中间可能需要输入密码等同意即可,等待安装配置完成

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
rvm requirements
Checking requirements for osx.
About to install Homebrew, press `Enter` for default installation in `/usr/local`,
type new path if you wish custom Homebrew installation (the path needs to be writable for user)
: 
==> This script will install:
......
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: openssl...
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.

6. 安装ruby

1
2
3
4
rvm install 2.3.0
......
Install of ruby-2.3.0 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

7. 安装完成

1
2
ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]