前言
最近更新cocoapods失敗后一直安裝不成功, 我嘗試了各種方法, 最終安裝成功, 在這里給大家分享一下安裝過程中報(bào)的錯(cuò)和解決辦法.在這里不介紹cocoapods的安裝步驟.
錯(cuò)誤1:
[!] /usr/bin/Gitclone 'https://github.com/CocoaPods/Specs.git' master --depth=1
Cloning into 'master'...
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly
解決辦法:
終端輸入如下命令:
sudo rm -fr ~/.cocoapods/repos/master
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
然后在執(zhí)行命令:( 1048576000 =1000×1024×1024, 也就是1000M, 最新的cocoapods 900多M的大小)
git config http.postBuffer 1048576000
大概20分鐘左右安裝成功, 可是執(zhí)行命令pod search fmdb報(bào)錯(cuò)
錯(cuò)誤2:
[!] Unable to find a pod with name, author, summary, or description matching
fmdb
然后我們?cè)诮K端輸入命令:
rm ~/Library/Caches/CocoaPods/search_index.json
出現(xiàn):
Creating search index for spec repo 'master' 等待大概5分鐘左右會(huì)出現(xiàn) Creating search index for spec repo 'master' .. done !表示完成 這個(gè)時(shí)候再輸入查詢命令查到第三方類庫!大功告成!
總結(jié):
更新找這個(gè)cocoapods用了我不少的時(shí)間, 最終解決這個(gè)問題,也是挺有成就感的, 寫下這騙文章希望能給需要的你一點(diǎn)幫助!