1. 問題
最近在同事電腦上執(zhí)行 pod install 會出現(xiàn)不響應的情況挂滓。
Cloning spec repo`cocoapods`from`https://github.com/CocoaPods/Specs.git`# 過了很久很久沒反應[!]Unable to add a sourcewithurl`https://github.com/CocoaPods/Specs.git`named`cocoapods`.You cantryadding it manuallyin`/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
gitclone--depth1https://github.com/CocoaPods/Specs.git master
此時應該已經(jīng)解決了木蹬。
3. 其他報錯情況
如果執(zhí)行第二步后仍有以下報錯。(PS:我沒實際遇到過若皱,解決問題時找到別的帖子镊叁,順手記錄了下來)
error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failed
執(zhí)行以下命令
git config--globalhttp.postBuffer5242880004. 追蹤遠程分支
git remote set-branches origin '*'
轉(zhuǎn)載:http://www.reibang.com/p/db68dcf8e87f