更新cocoapods 时遇到问题及解决

本文介绍了解决在安装CocoaPods过程中遇到的错误,包括gem版本过低及因苹果启用无根安装导致的问题,并提供了解决方案。

运行命令 sudo gem install cocoapods

报错: ERROR: While executing gem ... (OpenSSL::SSL::SSLError) hostname "upyun.gems.ruby-china.org" does not match the server certificate

ERROR:  While executing gem ... (OpenSSL::SSL::SSLError)
    hostname "upyun.gems.ruby-china.org" does not match the server certificate
复制代码

原因是 cocoapods 依赖的 gem 版本过低 升级

执行命令 sudo gem update --system

Updating rubygems-update
Fetching: rubygems-update-2.6.7.gem (100%)
Successfully installed rubygems-update-2.6.7
Parsing documentation for rubygems-update-2.6.7
Installing ri documentation for rubygems-update-2.6.7
Installing darkfish documentation for rubygems-update-2.6.7
Installing RubyGems 2.6.7
RubyGems 2.6.7 installed
Parsing documentation for rubygems-2.6.7
Installing ri documentation for rubygems-2.6.7

=== 2.6.7 / 2016-09-26

复制代码

再次运行 sudo gem install cocoapods

报错:While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/xcodeproj

原因:在stackoverflow搜到的解释是这样的,This is happening because Apple has enabled rootless on the new install,也就是说在10.11系统上苹果已经启用无根的安装。

解决方案:如下的命令:sudo gem install -n /usr/local/bin cocoapods

升级成功。

转载于:https://juejin.im/post/5a31d5785188256e174e179d

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值