安装cocoapods时候出现错误如下: sudo gem install cocoapods ERROR: While executing gem … (OpenSSL::SSL::SSLErro

安装cocoapods时候出现错误如下:

sudo gem install cocoapods
ERROR: While executing gem  (OpenSSL::SSL::SSLError)
hostname upyun.gems.ruby-china.org does not match the server certificate
  • 1
  • 2
  • 3

解决方法如下:

查看当前ruby源列表

gem source -l
  • 1

如果显示:

\* CURRENT SOURCES *
https://ruby.taobao.org/
  • 1
  • 2

添加新的ruby源即可解决

gem sources r https://ruby.taobao.org/
gem sources -a https://gems.ruby-china.org
sudo gem update system
  • 1
  • 2
  • 3

最后重新安装cocoapods

sudo gem install cocoapods
  • 1

你可能感兴趣的:(CocoaPods)