问题:pod install 时一直卡在Analyzing dependencies,然后等待很久后报timeout,一脸懵
网上很多方案时,找到Podfile文件,添加:
source 'https://github.com/CocoaPods/Specs.git'
然后,,,依旧卡,pod install Response: SSL connect error,查下来基本都说是网络问题,如果要用这个就只能等半夜网络环境好的时候下载!!!或者换科学上网,然而依旧慢啊!!
没关系,我就换了手动安装本地库,速度快很多:
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/trunk
但是!!这个命令执行一段时间后,由于我的网络环境太渣,一直失败。。。。。
最后妥协了,换了国内镜像:
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git ~/.cocoapods/repos/trunk
瞬间起飞!!!
记录下我提前做的查询:
1、查询ruby镜像:
gem sources -l
显示:https://gems.ruby-china.com/
2、通过查看命令,查看是否可用
pod search AFNetworking
上述都没有成功就把cocoapods重新安装下:
// 安装最新版cocoapods
sudo gem install cocoapods --pre
// 移除本地master
sudo rm -fr ~/.cocoapods/repos/master
// 移除本地缓存
sudo rm -fr ~/Library/Caches/CocoaPods/
// 重新setup
pod setup
然后再手动下载库