Cocoapods安装错误解决方案

来源:互联网 发布:不动点 知乎 编辑:程序博客网 时间:2024/05/19 10:08
最近换了台笔记本,在安装cocoapods中出现了这么一个错误,研究了许久,终于有了解决的方法,并且提供给大家,希望能起到作用:

错误提示为
Setting up CocoaPods master repo
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into ‘master’…
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

解决方案
首先通过终端cd到~/.cocoapods/repos下,在此目录下,输入终端命令:
git clone ‘https://github.com/CocoaPods/Specs.git’ master

剩下的就是漫长的等待,文件比较大,可能花费些时间,结果如下所示:

Cloning into ‘master’…
remote: Counting objects: 760233, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 760233 (delta 12), reused 0 (delta 0), pack-reused 760197
Receiving objects: 100% (760233/760233), 350.74 MiB | 44.00 KiB/s, done.
Resolving deltas: 100% (324910/324910), done.
Checking connectivity… done.
Checking out files: 100% (98969/98969), done.
完成后就可继续安装,即使用:pod setup命令。
出了这个错误意外还可能出现其他错误,错误情况请考虑如下是否存在:
1.ruby源不正确,请google
2.ruby版本不正确,请google
3.最新的mac os与之前的安装方式不一样,请google

2 0