安装cocopods遇到新问题

来源:互联网 发布:网络教学 编辑:程序博客网 时间:2024/05/16 22:27

在我们大天朝,使用网络都是被监控的,我们安装cocopods的时候之前都会从网上搜索很多解决办法,但是发现新的https://ruby.taobao.org/已经不再维护了。所以我们在安装的时候会一直遇到证书问题。同时我们公司的网络同样存在动态修改用户host的功能(这个好像有),所以被迫使用新的网络,然后将错误提示和新的请求办法贴出来。
执行sudo gem install 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 storeERROR:  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)

其实只要是使用gem的都会又ssl证书问题。
下面说下用的新路径

gem sources --remove https://ruby.taobao.org/gem sources -a https://gems.ruby-china.org/gem sources -lsudo gem install -n /usr/local/bin cocoapods

然后就会执行成功了,不过此刻会卡住,其实是在下载文件,你可以用下面的方法查看下载的文件大小。

cd ~/.cocoapods/du -sh *

到此就可以说是解决了这个问题了。

0 0