先安装gcc环境
yum install gcc-c++获取密钥
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB获取rvm
curl -sSL 根据输出的提示执行
source /home/gy/.rvm/scripts/rvm可以使用rvm命令,列出所有已知源
rvm list known输出如下
# MRI Rubies[ruby-]1.8.6[-p420][ruby-]1.8.7[-head] # security released on head[ruby-]1.9.1[-p431][ruby-]1.9.2[-p330][ruby-]1.9.3[-p551][ruby-]2.0.0[-p648][ruby-]2.1[.10][ruby-]2.2[.10][ruby-]2.3[.7][ruby-]2.4[.4][ruby-]2.5[.1][ruby-]2.6[.0-preview2]ruby-head安装ruby,需要一定时间(好几分钟)
rvm install ruby-2.5.1切换使用当前版本(有时候不指定的话,gem命令无法识别)
rvm use 2.5.1 default验证
// 执行命令ruby -v// 成功输入如下ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]执行安装redis与ruby的接口
gem install redis安装成功提示如下
Fetching: redis-4.0.2.gem (100%)Successfully installed redis-4.0.2Parsing documentation for redis-4.0.2Installing ri documentation for redis-4.0.2Done installing documentation for redis after 0 seconds1 gem installed