我們?cè)诎惭bcocoapods時(shí)粱侣,pod setup時(shí)出錯(cuò)
錯(cuò)誤情況一:
$ pod setup Setting up CocoaPods master repo [!] /usr/bin/git clone [https://github.com/CocoaPods/Specs.git](https://github.com/CocoaPods/Specs.git) master Cloning into ‘master’…error:RPC failed; curl56SSLRead()returnerror -9806fatal:The remoteendhung up unexpectedlyfatal:early EOFfatal:index-pack failed
錯(cuò)誤情況二:
$ pod setup Setting up CocoaPods master repo [!] /usr/bin/git clone [https://github.com/CocoaPods/Specs.git](https://github.com/CocoaPods/Specs.git) master Cloning into ‘master’…error:RPC failed; curl18transfer closed with outstanding read data remainingfatal:The remoteendhung up unexpectedlyfatal:early EOFfatal:index-pack failed
我們知道pod setup這一步等待的時(shí)間非常漫長(zhǎng)瞒渠,有可能等了幾個(gè)小時(shí)最終卻失敗备禀,不得不查找解決辦法重來绑咱。
以上兩個(gè)錯(cuò)誤的解決辦法
1. 檢查版本更新
$ sudo gem update --system
2.卸載老的cocoapods
$ sudo gem uninstall cocoapods
卸載完之后,終端會(huì)出現(xiàn)以下內(nèi)容
Selectgemtouninstall: 1.cocoapods-1.3.12.cocoapods-1.4.0.beta.23.cocoapods-1.5.04.Allversions>
終端幫你列舉出了所有的cocoapods版本蛙讥,你在末尾的“>”后面直接輸入對(duì)應(yīng)的序號(hào)候醒,就是卸載序號(hào)對(duì)應(yīng)的版本,例如輸入1哼绑,就是卸載cocoapods-1.3.1岩馍,輸入4,就是卸載所有版本抖韩,這里你直接輸入4即可蛀恩。
3.重裝
$ sudo gem install -n /usr/local/bin cocoapods --pre
如果你的mac系統(tǒng)是10.11之前,則輸入“sudo gem install cocoapods”
4.終端輸入如下2條指令
$ sudo chmod +rx /usr/local/bin
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
注意:上面的第2條指令中茂浮,-switch后面的路徑有些人可能不同双谆,你直接從你的應(yīng)用程序里,將Xcode子文件中的Developer直接拖到終端即可
5. pod setup
$ pod setup
成功之后席揽,終端出現(xiàn)如下內(nèi)容
]