关于CocoaPod安装常见问题(error: RPC failed; curl 56 SSLRead() return error -36)

关于CocoaPod安装常见问题(error: RPC failed; curl 56 SSLRead() return error -36)

问题如下:

Setting up CocoaPods master repo 按照网上说法:

使用命令 cd ~/.cocoapods/,再输入 du -sh * 查看到100M多就可以了,我发现我的问题是每次下载过程中会出现:

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

Cloning into 'master'...

error: RPC failed; curl 56 SSLRead() return error -36

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

解决:

在终端输入以下命令:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developers

后面的地址你可以打开Xcode显示包内容,找到那个文件夹拖到终端里面。

然后显示如下:

.cocoapods ABC$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Password:

ABCdeMacBook-Pro:.cocoapods ABC$ pod search AF

Setting up CocoaPods master repo

Setup completed

Creating search index for spec repo 'master'.. Done!

xujianfengdeMacBook-Pro:.cocoapods xujianfeng$

到这我的就安装成功了

(4)如果还是没有安装成功:

尝试:删除.cocoapods目录,在终端输入以下命令:

cd ~/.cocoapods/

sudo -rm -rf ~/.cocoapods/

然后,重新下载安装,在终端输入以下命令:

pod setup

安装成功后如果不 sudo -rm -rf ~/.cocoapods/则安装成功后:会报错:

CocoaPod [!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`

解决:rm ~/Library/Caches/CocoaPods/search_index.json

#以下是参考://www.greatytc.com/p/d2d81b58d716

一,参考了这个链接(git上一个大神的回答)

删除cocoapods的索引,然后重新search,

在terminal下

rm ~/Library/Caches/CocoaPods/search_index.json

pod search AFNetworking

Creating search index for spec repo 'master'..

会触发cocoapods重新拉这个索引文件

二,重新安装cocoapods

参考了这个链接(很多人都转载的一个

1、 先移除掉/Users/Ansel/.cocoapods/repos/master

2、再重新安装CocoaPods , 安装命令

gem sources --remove https://rubygems.org/

gem sources -a https://ruby.taobao.org/

sudo gem install -n /usr/local/bin cocoapods

xcode-select -switch /Applications/Xcode.app/Contents/Developer

后面这两步我没用,因为没有看到解释,我是后面直接pod setup了一下,等于重现安装了

我首先选用了第一种方式,即删掉了本地的search_index.json文件,发现还是找不到第三方库,然后的确在我的search_index.json里没有那个库的名字,然后我怒而重装(既选择第二种方式),还是如此。

最后只好去找同事(在他那里一直是可以search到那个第三方库的)拷贝了他本地的search_index.json,解决了。

抱着好奇心,我发现我重装cocoapods后,没有再尝试rm那个文件试试,果然,重装cocoapods后,再rm search_index.json,也是好使的。

所以问我废话了这么多,解决方式看起来有三中可能

使用第一种

使用第二种

使用第二种不好使后,再使用第一种

如果都不好使,那就去copy一个同事本地的吧,认栽。

如果需要本地的repo文件,可以联系我QQ:1139458375

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容