iOS开发Debug之CocoaPods安装可能遇到的问题

转自:点击打开链接


(1)在终端输入以下命令:

pod repo list

结果为0 repos时说明安装不成功,自己可以查看下自己的安装步骤,看看是哪一步出现了问题。

(2)出现以下错误:

ERROR:  While executing gem ... (Errno::EPERM)

Operation not permitted - /usr/bin/xcodeproj

在网上寻找的解决方法:

在终端中输入:sudo nvram boot-args="rootless=0"; sudo reboot

然后你的电脑会重启

之后再输入sudo gem install cocoapods -V

就可以了。

(3)pod setup时出现以下错误:

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...

error: RPC failed; curl 56 SSLRead() return error -36

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

自己按照提示在终端输入以下命令:

pod repo add master https://github.com/CocoaPods/Specs.git

还是报错!

在网上查到的解决办法:在终端输入以下命令:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developers

后面的地址你可以打开Xcode显示包内容,找到那个文件夹拖到终端里面。

(4)当出现如下:

[!] An error occurred while performing `Git pull` on repo `master`.

[!] /usr/bin/git pull --ff-only

这个错误应该是说这个节点有问题。把cocoapods的节点删除,重新添加一个节点。

删除master分支 重新建立新的分支

sudo rm -fr ~/.cocoapods/repos/master

然后再: pod setup

(5)出现The dependency `AFNetworking ` is not used in any concrete target

 podfile升级之后到最新版本,pod里的内容必须明确指出所用第三方库的target,否则会出现The dependency `` is not used in any concrete target这样的错误。

看这里

(6)试过以上所有解决办法,还是没有安装成功:

重新安装(其实我就是这样安装成功的):

首先,删除.cocoapods目录,在终端输入以下命令:

sudo rm -rf ~/.cocoapods/

然后,重新下载安装,在终端输入以下命令:

pod setup


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值