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
然后執(zhí)行以下命令:
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!
在執(zhí)行Pod Search AFNetWorking的時候,發(fā)現(xiàn)終端輸出以下錯誤:
[!] CDN: trunk URL couldn't be downloaded: xxxxxx
經(jīng)查,需要執(zhí)行如下操作,即可正常搜索
執(zhí)行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
執(zhí)行
pod update --verbose
總是兜兜轉(zhuǎn)轉(zhuǎn) 我就留了一個master然后 竟然可以了
image.png
