cocoapods使用中出现的问题(Mark)

  1. 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

【解决方法】
执行sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer,(或者先在终端输入”sudo xcode-select -switch “,然后,打开Xcode—>右键显示包内容,找到Developer文件夹拖到终端里面)。

PS:一些xcode-select的命令的使用:
xcode-select [-help]
xcode-select [-switch xcode_folder_path]
xcode-select [-print-path]
xcode-select [-version]
例如:
打印当前xcode的路径
xcode-select –print-path
输出:
/Applications/Xcode.app/Contents/Developer

  1. MacOS 10.11以上,sudo gem install cocoapods不生效了,因为10.11把cocoapods直接干掉了

【解决方法】
执行
sudo gem install -n /usr/local/bin cocoapods
sudo chmod +rx /usr/local/bin
再加一句,完美解决
sudo xcode-select –switch /Applications/Xcode.app

在终端中输入如下命令来完成安装:
//将 CocoaPods Specs repository复制到你电脑上~/.cocoapods目录下
pod setup
它需要一点时间来完成,你等就是了
如果终端出现以下内容
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into ‘master’…
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

那么应当移除原来的cocoapods
sudo gem uninstall cocoa pods

回车以后出现
Remove executables:
pod, sandbox-pod

in addition to the gem? [Yn] y
在[Yn] 后面填写 y 然后回车
出现
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.0.0

后重新编写
sudo gem install -n /usr/local/bin cocoapods
sudo chmod +rx /usr/local/bin

pod setup

如果安装失败 ~/.cocoapods 里面是空的,就需要重新setup
命令如下:
pod repo remove master
pod setup

完毕之后这个文件夹大概有 100多M,需要花费比较多时间,请耐心等待。
到这里你已经成功安装了CocoaPods。


    1. 4.

    1. 6.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值