背景:windows10 OS 64位
Ruby、gem已经安装完成
问题:CMD执行命令:gem install redis-dump
下载中断并报错:While executing gem ... (Gem::RemoteFetcher::FetchError)
too many connection resets (https://api.rubygems.org/gems/yajl-ruby-1.4.1.gem)
原因:RubyGems镜像源服务器域名更换
解决:首先建议在安装Ruby时不要修改安装路径(与此ERROR无关)!
1.查看当前镜像源域名:
gem sources -l
2.如果是.org的域名则需要更换,首先删除当前源
gem sources --remove 域名(上一步查看显示的域名)
3.添加新的源(此处使用清华镜像):
gem sources -a https://mirrors.tuna.tsinghua.edu.cn/rubygems/
4.再次执行gem install redis-dump即可安装redis-dump
5.如果是SSL 证书问题,修改
~/.gemrc
文件,增加ssl_verify_mode: 0
配置,RubyGems 可以忽略 SSL 证书错误--- :sources: - https://gems.ruby-china.com :ssl_verify_mode: 0