关于cocoapods的问题

由于很久没有更新使用过了pod install,导入第三方框架,结果发现之前配置的国内连接失效了,遇到的情况是:

[!] Oh no, an error occurred. 错误

这个错误然后查了一下最终确定的就是cocoapods升级新的版本了,然后顺便发现还是报镜像有问题,所以个人就把镜像资源给删空了

查看gem来源列表:$ gem sources -l
#查询到的列表的内容 将列表(如多个一个一个移除)
然后进行移除操作
格式:gem sources --remove xxxxxxx(https://rubygems.org)xxx等于https://rubygems.org 
正确操作如下
gem sources --remove https://rubygems.org

国内Specs

  1. 清华大学镜像

    https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git

  2. 上海大学镜像

    https://mirrors.shu.edu.cn/CocoaPods (仅HTTP/HTTPS访问,不支持git拉取)
    https://mirrors.shu.edu.cn/mgit/Specs (仅git访问)
    https://git.shuosc.org/CocoaPods/Specs (均支持)

  3. COCOAPODS SPECS 中国区镜像表项

    git://cocoapodscn.com/Specs.git

使用方法

对于旧的版本CocoaPods 可以使用如下国内的镜像(以清华镜像为例子)

pod repo remove master
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
pod repo update

新版的CocoaPods不允许pod repo add直接添加master库中但是可以这样

cd ~/.cocoapods/repos 
pod repo remove master
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master

最后进入自己的工程,在工程上的podFile文件中第一行加入

source ‘[https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git](https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git)’

你可能感兴趣的:(关于cocoapods的问题)