今天更新Pod时发现一些第三方开源库在官网已经更新,然而我用pod搜不到,再去gihhub一看上面也更新了,就想应该是我安装的pod有问题重新安装一下。
# 首先更新一下 gem
$ sudo gem update --system
# 然后更换一下镜像站点
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
http://ruby.taobao.org/
https://ruby.taobao.org
# 请确保只有 ruby.taobao.org
$ gem install rails
# 安装 CocoaPods(os x 10.11以以下)
$ sudo gem install -n /usr/local/bin cocoapods
# 安装 CocoaPods(os x 10.11或以上)
$ sudo gem install -n /usr/local/bin cocoapods
# 再加一句,完美解决
$ sudo xcode-select --switch /Applications/Xcode.app
# 更新框架库, 此有350M多流量(ActivityMonitor看着下,慢)还遇到以下报错
//将 CocoaPods Specs repository复制到你电脑上~/.cocoapods目录下
$ pod setup
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master
Cloning into 'master'...
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
# 用以下这个命令来能解决问题:
$ sudo gem uninstall cocoa pods //交互时选择 y
$ pod repo remove master
# 然后重新安装即可
pod setup