步骤:
1.
gem sources --remove https://rubygems.org/
2.
1
2
3
4
5
<code>gem sources -a https:
//ruby.taobao.org/
Error fetching https:
//ruby.taobao.org/:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: ce
rtificate verify failed (https:
//rubygems-china.oss-cn-hangzhou.aliyuncs.com/spe
cs.4.8.gz)</code>
3.
1
2
<code>gem sources -l
*** CURRENT SOURCES ***</code>
问题出处:
http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat
https://gist.github.com/fnichol/867550
1
2
3
4
5
6
7
8
<code>I had this same issue
while
working on a Ruby project. I am using Windows 7 64bit.
I resolved this by:
Downloading the cacert.pem file from http:
//curl.haxx.se/ca/cacert.pem.
Saved that file to C:/RubyCertificates/cacert.pem
Then set my environmental variable
"SSL_CERT_FILE"
to
"C:/RubyCertificates/cacert.pem"
source: https:
//gist.github.com/fnichol/867550</code>
证书地址:http://curl.haxx.se/ca/cacert.pem
按照上面这位网友的方法配置了环境变量如下图
再次执行gem sources -a https://ruby.taobao.org/
报错依旧
有谁遇到过,还是我的环境变量没有配置对呢?
ringa_lee2017-04-24 09:14:42
现在淘宝的gem停止更新维护了,目前是ruby-china维护。
gem source --remove https://ruby.taobao.org/ --add http://gems-china.org/
伊谢尔伦2017-04-24 09:14:42
遇到同样问题,按照https://gist.github.com/fnichol/867550 的步骤执行后顺利通过(需要注销机子)。
不过我是添加到系统变量,不知道是不是这个原因。