最近更新pod本地库时总是报一个错误,[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down,刚开始以为是网络的原因,后来发现并不是的,后来猜想可能是gem版本过低,于是在终端中执行
$ sudo gem update --system
发现执行不了,并且报另外一个错误,错误如下
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
在网上查了一下,发现要更新rvm版本,于是打开终端:
$ curl -L https://get.rvm.io | bash -s stable
等待一段时间后就可以成功安装好 RVM。然后,载入 RVM 环境
$ source ~/.rvm/scripts/rvm
查询版本
$ rvm list known
# 安装一个版本,我安装的是2.4.1
$ rvm install 2.4.1
安装完成后,就可以更新pod版本了,安装完pod后,发现有两个提醒
Ignoring executable-hooks-1.4.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.4.2
Ignoring gem-wrappers-1.3.2 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.3.2
直接按照提示Try来在命令行分别执行者两句
$ gem pristine executable-hooks --version 1.4.2
$ gem pristine gem-wrappers --version 1.3.2
再执行pod repo update master就可以更新成功了。