环境:
CentOSrelease6.6(Final) 2.6.32-504.el6.x86_64
1、安装rvm
gpg--keyserverhkp://keys.gnupg.net--recv-keys409B6B1796C275462A1703113804BB82D39DC0E3 \curl-sSLhttps://get.rvm.io|bash-sstable
如果不行去掉https再试下
curl-Lget.rvm.io|bash-sstable
如果都有报错执行
curl-sSLhttps://rvm.io/mpapis.asc|gpg2--import-
然后继续执行
curl-Lget.rvm.io|bash-sstable
2、使配置文件生效
source/etc/profile.d/rvm.sh
3、下载RVM依赖
rvmrequirements
4、安装ruby依赖包
yuminstallgcc-c++patchreadlinereadline-develzlibzlib-devel\ libyaml-devellibffi-developenssl-develmake\ bzip2autoconfautomakelibtoolbisoniconv-develsqlite-devel
5、更换rvm源为淘宝的
sed-i-E's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!'$rvm_path/config/db
6、安装ruby 2.1.1版本
rvminstall2.1.1 rvmuse2.1.1--default
7、测试
ruby--version原文链接:https://www.f2er.com/centos/379666.html