1、
pod update 的時候出現下邊的錯誤
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
[!] 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.1更新http下載對速度的限制因為curl的postBuffer默認值太小的原因,而項目可能本身比較大,所以下載失敗。1、Git config –global http.postBuffer 524288000結果都以失敗告終。
解決方案看了簡書的一篇文章:上面錯誤主要是os10.11+和cocoapods1.0+版本升級的安全機制更改造成的。主要出現在pod setup過程中。且該過程等待時間非常長,所以,你可以在$sudo gem install -n /usr/local/bin cocoapods命令后直接執行$Gitclone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 該過程作用與 pod setup作用相同,作者親測。效果極佳!!!!
然后去看了https://git.coding.net/CocoaPods/Specs.git遠端代碼索引庫!結果作者停止更新了!
然后我就想起最終解決方案:
2、解決第一步:
$sudo gem install -n /usr/local/bin cocoapods
第二步:
$Git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
完美解決!!!