步骤1 - 安装 RVM
RVM是干什么的这里就不用解释了,后面会明白。
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ curl -sSL https://get.rvm.io | bash -s stable
# 如果上面的连接失败,可以尝试:
$ curl -L https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable
配置RVM与运行环境
安装完RVM之后,我们需要使用如下命令设置RVM运行环境。# source /etc/profile.d/rvm.sh
安装所需版本的Ruby
# rvm install 1.9.3
安装其他版本(如果有需要的话)
# rvm install 1.8.6
设置Ruby默认版本
# rvm use 1.9.3 --default
查看现在Ruby的版本号
ruby --version