mac升级10.12的cocoapods问题

升级mac到10.12之后,pod用不了,查资料发现,https://ruby.taobao.org/已经更换到https://gems.ruby-china.org这个了,于是更换镜像source,

gem source –r https://ruby.taobao.org/

gem source –a https://gems.ruby-china.org

执行sudo gem install -n /usr/local/bin cocoapods

还是报错,有两个错误

第一种报

ERROR:While executing gem ... (OpenSSL::SSL::SSLError)

hostname "gems.ruby-china.org" does not match the server certificate

证书问题,找了半天也没解决

第二种报

ERROR:While executing gem ... (Gem::DependencyError)

Unable to resolve dependencies: cocoapods requires cocoapods-core (= 1.2.1), cocoapods-downloader (< 2.0, >= 1.1.3), cocoapods-trunk (< 2.0, >= 1.2.0), molinillo (~> 0.5.7), xcodeproj (< 2.0, >= 1.4.4), colored2 (~> 3.1), ruby-macho (~> 1.1)

于是开始升级gem,执行sudo gem update --system

接着执行上面的还是不行,最后我把https://gems.ruby-china.org这个替换成

http://gems.ruby-china.org,使得没错,我把https换成http,结果解决了。

你可能感兴趣的:(mac升级10.12的cocoapods问题)