https://blog.csdn.net/u012709932/article/details/105044238
一直想pod search AFNetworking
...但是用不了
[!] CDN: trunk Repo update failed - 17 error(s): CDN: trunk URL couldn‘t be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/1/d/4/CocoaAsyncSocket/0.0.1/CocoaAsyncSocket.podspec.json, error: Operation timed out - SSL_connect ...
...
解决办法
1,首先要安装 Xcode 命令行工具
xcode-select --install
2,查看版本
pod --version
3,查看gem源
gem sources
如果不是源:https://gems.ruby-china.com ,使用以下方式增加新源:
添加源
gem sources -a https://gems.ruby-china.com
删除之前的源
gem sources --remove https://gems.ruby-china.org/
然后查看源:
gem sources
4,使用源安装CocoaPods库
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
如果特别慢,使用以下源安装CocoaPods库
git clone https://gitee.com/mirrors/CocoaPods-Specs.git ~/.cocoapods/repos/master
然后执行以下命令:
pod setup
使用CocoaPods:
打开podfile文件指定旧方式下载。
**// source** 源地址
**source** ‘**https://github.com/CocoaPods/Specs.git**’
我这边pod文件里写的是
source 'https://gitee.com/mirrors/CocoaPods-Specs.git'
platform:ios,'9.0'
use_frameworks!
在执行Pod Search AFNetWorking的时候,发现终端输出以下错误:
[!] CDN: trunk URL couldn't be downloaded: xxxxxx
经查,需要执行如下操作,即可正常搜索
执行pod repo remove trunk移除trunk源,pod search就都正常了!
源使用可以如下
platform:ios,'9.0'
source 'https://gitee.com/mirrors/CocoaPods-Specs.git'
use_frameworks!
target "" do
….
遇到如下问题
[!] Unable to find a specification for
执行
pod update --verbose
总是兜兜转转 我就留了一个master然后 竟然可以了
image.png
网友评论