美文网首页
CocoaPods安装出现SSL verification er

CocoaPods安装出现SSL verification er

作者: 忧郁的小码仔 | 来源:发表于2017-06-15 17:02 被阅读60次

    在安装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环境。

    1.更新Ruby环境

    1.首先要安装 Homebrew 终端输入这条命令即可

    /usr/bin/ruby -e "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    2.安装rvm

    $ curl -L get.rvm.io | bash -s stable 
    

    3.装载rvm

    $ source ~/.rvm/scripts/rvm 
    

    4.安装2.3.0版本ruby

    $ rvm install 2.3.0 
    

    5.将2.3.0设为默认

    $ rvm use 2.3.0 --default
    

    2.解决证书问题

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

    相关文章

      网友评论

          本文标题:CocoaPods安装出现SSL verification er

          本文链接:https://www.haomeiwen.com/subject/kdruqxtx.html