- 统一小组成员cocoapods源,若不指定podFiles中库的版本,会造成更新版本不一致有些库中的文件没有。
查看当前pod repo源
$ pod repo
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/cheng/.cocoapods/repos/master
1 repo
- Mac上查看cocoapods是否已有master文件夹
cmd+shift+G打开“前往文件夹”
输入 ~/.cocoapods
一、坚持使用默认源github(下载过程需要持续几个小时,最新库)
- 非墙状态下下载过慢会提示失败
Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
- 解决办法1:延长时间
$ git config --global http.postBuffer 524288000
$ git config --global http.lowSpeedLimit 0
$ git config --global http.lowSpeedTime 999999
-
解决办法2:直接去https://github.com/CocoaPods/Specs下载,解压后放到~/.cocoapods/repos/master中
-
补充:homebrew安装cocoapods卡住
1.$sudo gem install cocoapods 备注:苹果系统升级 OS X EL Capitan 后改为$sudo gem install -n /usr/local/bin cocoapods
2.$pod setup
注:无限卡在Setting up CocoaPods master repo
1.终端输入cd ~/.cocoapods
2.打开网站https://github.com/CocoaPods/Specs.git,下载,为了和github建立连接
3.command+n,打开另一个终端,输入pod setup(打开了两个终端)
4.在第一个终端输入su -sh 查看下载速度,大约350M完成
————————————————
版权声明:本文为CSDN博主「EmulateStep」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/emulatestep/article/details/51644903
二、更换国内源(下载过程需要几分钟即可,但有些库版本比github上低)
- 对于旧版的 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
更改后下载速度飞起
Cloning into '/Users/ln/.cocoapods/repos/master'...
remote: Counting objects: 3881266, done.
remote: Compressing objects: 100% (1164329/1164329), done.
remote: Total 3881266 (delta 2504277), reused 3871199 (delta 2496558)
Receiving objects: 100% (3881266/3881266), 636.76 MiB | 3.33 MiB/s, done.
Resolving deltas: 100% (2504277/2504277), done.
Checking out files: 100% (399144/399144), done.
- 项目中的podFile更改sources为国内源
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
网友评论