Cocoapod 1.9.1 問題解決

https://blog.csdn.net/u012709932/article/details/105044238

一直想pod search AFNetworking
...但是用不了

[!] CDN: trunk Repo update failed - 17 error(s): CDN: trunk URL couldnt 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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容