Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404

问题: 升级Cocospod的时候,报错。

环境 os: Mojave10.14.4 cocospod:1.6.0beta

报错:

ERROR:  Could not find a valid gem 'cocoapods' (= 1.6.1), here is why:
          Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

原因:

https://gems.ruby-china.org 镜像404了,不提供服务。

尝试:

尝试(更换淘宝镜像),发现淘宝镜像2018.12停止服务。 下面试错误过程:

NvrdeiMac:ValidateSwift nvr$ gem sources --remove https://gems.ruby-china.org/
https://gems.ruby-china.org/ removed from sources
NvrdeiMac:ValidateSwift nvr$ gem source -l
*** CURRENT SOURCES ***

NvrdeiMac:ValidateSwift nvr$ gem sources -a https://ruby.taobao.org/  
ERROR:  SSL verification error at depth 0: certificate has expired (10)
ERROR:  Certificate /C=CN/ST=ZheJiang/L=HangZhou/O=Alibaba (China) Technology Co., Ltd./CN=*.taobao.org expired at 2018-12-05T03:16:02Z
Error fetching https://ruby.taobao.org/:
	SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://ruby.taobao.org/specs.4.8.gz)

解决:

gem sources -a https://rubygems.org/

添加源来的ruby镜像,感觉速度不慢了。毕竟ruby-china也关了。

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券