Cocoapods pod update执行失败报错CocoaPods was not able to update the `master` repo.2019的解决

很久没动pod,最近更新发现:

CocoaPods报CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`错误。

使用命令pod repo update --verbose依然 不行,报同样的错,也检查了gem、pod版本,都没问题

不过偶然发现可能是淘宝镜像的问题:https://ruby.taobao.org,出现过以下报错:

Error fetching https://ruby.taobao.org:
bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

后来折腾许久,终于解决了,思路就是替换镜像。

1、查看当前镜像

gem sources -l 

2、由于我这边是淘宝的,就直接移除了

gem source -a https://ruby.taobao.org 

3、替换

gem sources --add https://gems.ruby-china.com

通过以上步骤,在执行我的pod update就可以了

仅供参考~

原文地址:https://www.cnblogs.com/yajunLi/p/10600849.html