Cocoapods:尝试集成库时出现错误 -9806

Cocoapods: Error -9806 while trying to integrate a library

我喜欢在我的 macOS 应用程序中集成一个 zip 库。

我使用 pod init 创建了 Podfile 并向其中添加了 pod:

# Uncomment this line to define a global platform for your project
platform :osx, '10.10'

target 'Test' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Test
  pod 'Zip', '~> 0.4'
end

但是如果我执行 pod install 我会在控制台上得到以下输出(尝试了几次):

Analyzing dependencies
Downloading dependencies
Installing Zip (0.4.3)

[!] Error installing Zip
[!] /usr/bin/git clone https://github.com/marmelroy/Zip.git /var/folders/n5/4f8c27g57tn94vhb7xcd95ww0000gp/T/d20160712-26003-1l6n5lt --template= --single-branch --depth 1 --branch 0.4.3

Cloning into '/var/folders/n5/4f8c27g57tn94vhb7xcd95ww0000gp/T/d20160712-26003-1l6n5lt'...
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed

使用 OpenSSL 安装 curl 后 pod install 成功了:

$ brew install --with-openssl curl