Pod Install 卡住報錯

1. 問題

最近在同事電腦上執(zhí)行 pod install 會出現(xiàn)不響應(yīng)的情況。

Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`

# 過了很久很久沒反應(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。不存在則跳過這一條命令。

pod repo remove master

接下來繼續(xù)執(zhí)行以下命令

pod setup
git clone --depth 1 https://github.com/CocoaPods/Specs.git master

此時應(yīng)該已經(jīng)解決了。

3. 其他報錯情況

如果執(zhí)行第二步后仍有以下報錯。(PS:我沒實際遇到過,解決問題時找到別的帖子,順手記錄了下來)

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. 追蹤遠程分支

git remote set-branches origin '*'
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容