cocoapods 安装出现问题

1.pod search AFN  如下错误

[!] CDN: trunk Repo update failed - 2 error(s):

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/4/a/2/afn/1.0.0/afn.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/4/a/2/afn/1.2.0/afn.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

执行pod repo remove trunk移除trunk源,pod search就都正常了


2.pod search 提示Unable to find a pod with name, author, summary, or description matching 'afnetworking'

解决方案:手动移除.cocoapods/repos目录下的master,然后Git clone 替换。

解决步骤:

1、在终端输入cd ~/.cocoapods/repos


2、移除master文件

3、输入命令:git clone --depth 1 https://github.com/CocoaPods/Specs.git master

4、等clone完成后,记得先删除search_index.json。pod search的时候会生成该文件,会主动记录之前搜索的行为存在本地,所以一般第二次搜索会比第一次快。

输入命令:rm ~/Library/Caches/CocoaPods/search_index.json回车

5、验证pod search 是否正常

转载自:https://www.jianshu.com/p/b60a309c014b?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation  非常感谢

你可能感兴趣的:(cocoapods 安装出现问题)