gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable #这个时候国内可能会显示Failed connect to raw.githubusercontent.com:443; 拒绝连接, 解决方案:vi /etc/hosts ,加入199.232.68.133 raw.githubusercontent.com , 这个真实ip可在https://www.ipaddress.com/中查询
# 根据安装提示信息
source /etc/profile.d/rvm.sh
source ~/.bashrc #如果你shell安装的是zsh,source ~/.zshrc
source ~/.bash_profile
- 修改 RVM 的 Ruby 安装源到 Ruby China 的 Ruby 镜像服务器,这样能提高安装速度
echo "ruby_url=https://cache.ruby-china.com/pub/ruby" > ~/.rvm/user/db
# 你的地址可能不是~/.rvm/user/db, 用whereis rvm看一下
echo "ruby_url=https://cache.ruby-china.com/pub/ruby" > /usr/local/rvm/user/db
rvm list known
rvm install 2.3.1 --disable-binary
rvm use 2.3.1
- 如果想设置为默认版本,这样一来以后新打开的控制台默认的 Ruby 就是这个版本
rvm use 2.3.1 --default
rvm list
rvm remove 1.8.7