コンパイラかく語りき

import { Fun } from 'programming'

【Cocoapods】 pod setupにて error: RPC failed; curl 56 SSLRead() return error -36| 2.27 MiB/s

発端

以下の記事に従っていた所、エラーが。

【Swift】CocoaPods導入手順 - Qiita

$ pod setup

Setting up CocoaPods master repo
  $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
  Cloning into 'master'...
  remote: Counting objects: 1827856, done.
  remote: Compressing objects: 100% (188/188), done.
  error: RPC failed; curl 56 SSLRead() return error -36| 2.27 MiB/s
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

Cloning into 'master'...
remote: Counting objects: 1827856, done.
remote: Compressing objects: 100% (188/188), done.
error: RPC failed; curl 56 SSLRead() return error -36| 2.27 MiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

解決

以下のStackoverflowの回答に従い、解決。

RPC failed; curl 56 SSLRead() return error -9806 MiB/s - stackoverflow.com

$ git config --global http.postBuffer 2M

gitのバッファを増やしました。

Setting up CocoaPods master repo
  $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
  Cloning into 'master'...
  remote: Counting objects: 1827856, done.
  remote: Compressing objects: 100% (189/189), done.
  remote: Total 1827856 (delta 90), reused 35 (delta 35), pack-reused 1827623
  Receiving objects: 100% (1827856/1827856), 503.62 MiB | 2.03 MiB/s, done.
  Resolving deltas: 100% (1001375/1001375), done.
  Checking out files: 100% (206551/206551), done.

CocoaPods 1.4.0.rc.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.4.0.rc.1

Setup completed

成功。

余談

pod setup がやっていることはCocoaPodsのレポジトリをcloneしているようなので、困ったらManualでcloneするのも手かもしれませんね。

Stackoverflowの回答より。

Finally, if https does not want to cooperate, try the ssh url:

cd  ~/.cocoapods/repos 
git clone git@github.com:CocoaPods/Specs.git