CocoaPods安装出现SSL verification error

来源:互联网 发布:健美创研化妆品知乎 编辑:程序博客网 时间:2024/06/03 18:16

在安装CocoaPods出现了以下问题:

ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority to your local trusted store
ERROR: SSL verification error at depth 2: self signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA)

出现这个问题的原因主要是Ruby环境需要2.2版本以上,所以要更新Ruby环境。


更新Ruby环境

0.首先要安装Homebrew终端输入这条命令即可/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
1.安装rvm$ curl -L get.rvm.io | bash -s stable
2.装载rvm$ source ~/.rvm/scripts/rvm
3.安装2.3.0版本ruby$ rvm install 2.3.0
4.将2.3.0设为默认$ rvm use 2.3.0 --default

证书错误问题

$ cd $rvm_path/usr/ssl$ sudo curl -O http://curl.haxx.se/ca/cacert.pem$ sudo mv cacert.pem cert.pem

这样就解决了上面的error



作者:Senjougahara
链接:http://www.jianshu.com/p/17043faee2e6
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
阅读全文
1 0
原创粉丝点击