最近执行pod install的时候需要clone master仓库文件,clone 了一下午,还是不行,上网找了一下原因,发现是pod 更新到了1.2版本,需要更新一下才行,于是开启了这次的填坑之旅。
填坑流程
搞了一天,最后总结出来的整体思路就是先把原来的pod卸载掉,然后重新安装最新的pod。
- 升级gem
sudo gem update --system
- 卸载cocoapods
sudo gem uninstall cocoapods
- 安装cocoapods
sudo gem install -n /usr/local/bin cocoa pods
- 初始化pod
pod setup
可能遇到的bug
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
pod Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.
Could not find 'cocoapods' (>= 0) among 64 total gem(s) (Gem::LoadError)
如果遇到上面这些错误,可以试一下卸载全部gem,然后重新安装pod
sudo gem uninstall --all
如果你有换过ruby源,可能需要换回原来的ruby源,就是下面这个地址
https://rubygems.org/