1. 問(wèn)題
最近在同事電腦上執(zhí)行 pod install 會(huì)出現(xiàn)不響應(yīng)的情況。
Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
# 過(guò)了很久很久沒(méi)反應(yīng)
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`.
You can try adding it manually in `/Users/xxx/.cocoapods/repos` or via `pod repo add`.
2. 解決方案
cd ~/.cocoapods/repos/
檢查一下 master 文件夾是否存在,如果存在 master 文件夾,執(zhí)行 pod repo remove master。不存在則跳過(guò)這一條命令。
pod repo remove master
接下來(lái)繼續(xù)執(zhí)行以下命令
pod setup
git clone --depth 1 https://github.com/CocoaPods/Specs.git master
此時(shí)應(yīng)該已經(jīng)解決了。
3. 其他報(bào)錯(cuò)情況
如果執(zhí)行第二步后仍有以下報(bào)錯(cuò)。(PS:我沒(méi)實(shí)際遇到過(guò),解決問(wèn)題時(shí)找到別的帖子,順手記錄了下來(lái))
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
執(zhí)行以下命令
git config --global http.postBuffer 524288000
4. 追蹤遠(yuǎn)程分支
git remote set-branches origin '*'