美文网首页留着看Cocoapods那些事
CocoaPods安装失败问题 RPC failed;

CocoaPods安装失败问题 RPC failed;

作者: Echo126 | 来源:发表于2017-04-25 14:41 被阅读451次

一:pod install的时候不成功,看网上说可以把master repo 移除掉,结果手贱导致悲剧了,安装时卡着不动了。然后试了好多方法,终于搞好了。这里只说最关键的一个地方。其他的别的帖子里都可以看到。下边是从终端复制出来的错误

$ /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

Cloning into 'master'...

remote: Counting objects: 1224483, done.

remote: Compressing objects: 100% (3301/3301), done.

error: RPC failed; curl 56 SSLRead() return error -9806024 bytes/s

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

[!] /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

Cloning into 'master'...

remote: Counting objects: 1224483, done.

remote: Compressing objects: 100% (3301/3301), done.

error: RPC failed; curl 56 SSLRead() return error -9806024 bytes/s

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

1.看到报这个错之后,需要在终端执行 sudo xcode-select -switch  /Applications/Xcode.app/Contents/Developer 这句,具体如下
  先找到xcode,显示包内容,在Contents里找到Developer文件,然后在终端输入sudo xcode-select -switch ,把找到的Developer文件夹拖进终端,就得到后边的路径啦,然后执行。因为xcode位置和版本安装的不一样,可能路径会有所不同。我的最终是sudo xcode-select -switch  /Applications/Xcode.app/Contents/Developer 这个。

重点来了,然后终端执行下边两句(我的就是执行这两句弄好的,第3点在很多文章里写得不对,导致安装路径错误)

2. sudo gem install -n /usr/local/bin cocoapods 
3. Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master

图里黄色框里的位置,就是下载的cocoaPod位置,上边是出错的那个路径,下边是正确的安装路径。可对比你自己的看看是不是跟我情况一下。

另:如果rvm或者ruby版本有问题的话,可参考下边链接文章重新安装和卸载cocopods。http://blog.csdn.net/yishengzhiai005/article/details/52878741 

二:pod search XXX时,出现Creating search index for spec repo 'master'.. ,卡了五分钟左右,然后搜出XXX版本信息了。

相关文章

网友评论

  • EmptyWalker:感谢博主 帮我解决了一个大问题

本文标题:CocoaPods安装失败问题 RPC failed;

本文链接:https://www.haomeiwen.com/subject/zslvzttx.html