关于Unable to download data from https://gems.ruby-china.org/

今天更新cocoapods版本的时候,安装会报出一个奇怪的错误

sudo gem install cocoapods

ERROR: Could not find a valid gem 'cocoapods' (>= 0), 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)

通过查找原因发现:sources 里面镜像链接 https://gems.ruby-china.org 被弃用

Screen Shot 2019-03-06 at 4.49.04 PM.png

需要重新换一下源:

gem sources --remove https://gems.ruby-china.org/
gem sources --add https://gems.ruby-china.com/
gem sources --list                               
*** CURRENT SOURCES ***

https://gems.ruby-china.com/

然后重新安装一下即可

sudo gem install cocoapods

如果有人遇到类似的问题,希望对你有所帮助。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容