1.安装curl
yum install curl
2.用curl安装rvm
curl -L get.rvm.io | bash -s stable
如果有错误如下:
Downloading https://github.com/rvm/rvm/archive/.tar.gz
curl: (35) SSL connect error
Could not download 'https://github.com/rvm/rvm/archive/.tar.gz'.
curl returned status '35'.
Downloading https://bitbucket.org/mpapis/rvm/get/.tar.gz
curl: (35) SSL connect error
Could not download 'https://bitbucket.org/mpapis/rvm/get/.tar.gz'.
curl returned status '35'.
说明nss版本比较旧,更新下就好了,更新如下:
yum -y update nss
(如果更新的话,记得重新执行下rvm的安装,因为刚才没安装成功curl -L get.rvm.io | bash -s stable)
3.执行2后,会看到如下截图,然后导入这个密钥
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
4.重新安装
curl -L get.rvm.io | bash -s stable
5.source一下
source /etc/profile.d/rvm.sh
6.列出版本
rvm list known
7.选择版本安装
rvm install 2.4.4
8.使用版本
rvm use 2.4.4
9.查看版本
ruby --version
参考:
https://blog.csdn.net/chenxinchongcn/article/details/78666374
https://blog.csdn.net/sdoyuxuan/article/details/79081873
https://www.jianshu.com/p/a703135682a3
https://blog.csdn.net/ctypyb2002/article/details/80982982