- 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
- 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。
-
- 4.
-
- 6.
-
- 8.