神剑若水哥:pod update 奇怪的报错

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 升级的时候,命令如下:

pod update 
报错提示: 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如下图:
图1
执行提示命令:pod repo update --verbose 报错还是存在,如下图

pod repo update --verbose

图2

问题解决:思路是先升级gem ,再重新安装pod

1.升级gem

1.1执行命令:sudo gem update -n /usr/local/bin --system

sudo gem update -n /usr/local/bin --system

又报错了:

ERROR: While executing gem ... (Errno::EPERM)

Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem ,说我们没给权限给 usr/bin/gem,如下图
图3

1.2 解决1.1这个问题,执行 sudo gem install -n /usr/local/bin cocoapods

sudo gem install -n /usr/local/bin cocoapods

图7

结果:如图gem 更新成功

2重新安装pod

2.1 删除缓存执行如下两个命令,可能等待时间有点长,多等一会吧。

rm -fr ~/Library/Caches/CocoaPods/

rm -fr ~/.cocoapods/repos/master/

2.2 安装pod 执行如下命令

gem install -n /usr/local/bin cocoapods

pod setup

如图所示2.1和2.2的结果图:

图9
结果还是报错:error: RPC failed; curl 18 transfer closed with outstanding read data remaining,大致意思是缓存不足

2.3 解决2.2问题,执行命令

git config --global http.postBuffer 524288000

成功后执行

pod upset

image-20190824144342179

其他问题:

pod setup 慢

如果你有翻墙工具的话,终端执行下面的命令吧
1080 就是你翻墙工具的端口号,注意修改。
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080

移除上面设置

git config --global --unset http.proxy

问题解决了,喜欢的点点赞吧。哈哈,有什么问题欢迎留言

你可能感兴趣的:(神剑若水哥:pod update 奇怪的报错)