最近運行pod setup出現以下問題:
remote: Compressing objects: 100% (34/34), done.error: RPC failed; curl 56 SSLRead() return error -3613.00 KiB/sfatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failed
我們知道 cocoapods 的 sepcs 文件是放在這個目錄裏面
~/.cocoapods/repos
所以可以直接 cd 到該目錄下然後運行命令:
git clone https://github.com/CocoaPods/Specs.git master
Cloning into 'master'...remote: Counting objects: 894306, done.remote: Compressing objects: 100% (56/56), done. ^Cceiving objects: 6% (53659/894306), 10.39 MiB | 216.00 KiB/s ...
然後會發現clone 的文件很大,由於速度也很慢,一不小心就失敗了。
其實我們無需全部 clone 下來,可以只 clone 最近一個 commit 的全部代碼就可以了。
git clone --depth=1 https://github.com/CocoaPods/Specs.git master
Cloning into 'master'...remote: Counting objects: 261047, done.remote: Compressing objects: 100% (179891/179891), done.remote: Total 261047 (delta 44498), reused 253721 (delta 44409), pack-reused 0Receiving objects: 100% (261047/261047), 44.76 MiB | 124.00 KiB/s, done. Resolving deltas: 100% (44498/44498), done. Checking connectivity... done. Checking out files: 100% (118515/118515), done.
不用多久就 clone 成功了,這時候就直接可以使用pod install 最新版本的 library 了。