https://blog.csdn.net/u012998306/article/details/99441637

 

为了安装redis-dump导出导入数据,安装ruby

所以就得安装rvm

rvm是ruby的版本管理工具  还可对ruby进行 安装 卸载 等

 

1.安装 curl
yum install  curl
然后

curl -L  get.rvm.io | bash -s stable
2.问题解决
此时问题就来了,有我遇到的问题也有在找问题的时候汇总收集的


按照提示输入命令

curl -sSL  https://rvm.io/mpapis.asc  |  gpg2  --import  -
继续在 命令行输入

curl  -L  get.rvm.io |  bash -s  stable
安装成功,然后查看列表

rvm  list known
②curl: (35) SSL connect error的解决方法
curl -L  get.rvm.io | bash -s stable
回车之后程序后一直没结果返回,等待一小段时间之后出现curl: (35) SSL connect error

解决办法

1.升级nss (Network Security Service, 网络安全服务)

yum update nss
2.如果没有nss,则需要安装nss服务

yum install nss
③curl HTTPS 报错curl: (7) couldn't connect to host
使用curl 命令,无法访问HTTPS,访问Http是正常的

使用curl -V查询版本以及支持的协议

测试将访问防火墙给关闭了

systemctl stop firewalld
 
或者
 
service iptables stop
再次尝试结果还是提示同样的问题,于是尝试将防火墙开机自启也关闭了

systemctl disable firewalld
 

 
chkconfig iptables off
正常访问 ,tar包开始下载

看来我的问题是出现在防火墙。

④curl -L get.rvm.io | bash -s stable 输入提示错误
在浏览器上访问get.rvm.io,实际跳转到如下地址

https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer

所以,修改命令:

curl -L https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable
3.安装rvm
问题解决了就开始安装rvm

find / -name rvm -print
 

source /usr/local/rvm/scripts/rvm
安装2.4.1版本 

rvm install 2.4.1
 使用这个版本

rvm use 2.4.1
因为CentOS7 yum库中ruby的版本支持到 2.0.0,可gem 安装redis-dump需要最低是2.2.2,所以我选择高于2.2的版本安装2.4.1

查看版本

ruby --version

 


本文转载:CSDN博客