iOS开源项目

iOS--pod install安装第三方库异常

2018-08-02  本文已影响168人  乐逍遥的笔记

使用cocapods导入百度SDK的时候,抛出了如下异常:

[!] Error installing BaiduMapKit
[!] /usr/bin/git clone https://github.com/BaiduLBS/BaiduMapKit.git /var/folders/n7/0n34ykf91_l17bhgtk_zb2kh0000gn/T/d20180802-3424-1cxqohl --template= --single-branch --depth 1 --branch 4.1.1

Cloning into '/var/folders/n7/0n34ykf91_l17bhgtk_zb2kh0000gn/T/d20180802-3424-1cxqohl'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

解决办法:
在终端运行如下语句:

sudo gem install cocoapods

<1>运行该语句后,如果出现以下情况,证明执行成功:

Parsing documentation for cocoapods-1.5.3
Done installing documentation for cocoapods after 2 seconds
1 gem installed

此时载执行下载操作即可:

pod install

<2>运行该语句后,如果出现以下情况,证明执行失败:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.

此时需要我们在执行另一步操作:

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

执行该命令后,出现以下提示,证明操作成功:

Parsing documentation for cocoapods-1.5.3
Done installing documentation for cocoapods after 2 seconds
1 gem installed

此时载执行下载操作即可:

pod install
上一篇 下一篇

猜你喜欢

热点阅读