解决pod安装插件时发生错误或访问git仓库缓慢的问题。
pod install 错误#
可以在iOS项目中Podfile文件中增加一行,修改cocopods的获取地址
source 'https://github.com/CocoaPods/Specs.git'
更改gem源#
查看源
gem sources -l
移除原有
gem sources --remove https://rubygems.org/
增加镜像地址
gem sources --add https://gems.ruby-china.com
- 由于gem源有可能变动,这里去 https://gems.ruby-china.com 查看最新即可
pod install 速度缓慢#
设置git全局代理。首先,需要自己有代理工具。查看代理工具的设置ip和端口
然后设置代理
git config --global http.proxy 'socks5://127.0.0.1:7891'
git config --global https.proxy 'socks5://127.0.0.1:7891'
git config --global https.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890
查看代理
git config --global --get http.proxy
git config --global --get https.proxy
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
经过上面的设置,pod可提升速度。