问题
When I tried to import Realm with CocoaPods like this:
pod install --verbose --no-repo-update
then error happened:
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
fatal: clone of 'https://github.com/ColinH/PEGTL' into submodule path '/private/var/folders/51/tzbm7yqs3bsck5vxz3xj5pkc0000gn/T/d20160925-2957-1pu1dou/Realm/ObjectStore/external/pegtl' failed
why?
回答1:
The above error is mainly caused by the change of the security mechanism of os10.11+ and cocoapods1.0+ version upgrade. Mainly in the pod setup process. And the waiting time for this process is very long
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
The same effect as pod setup
回答2:
Mac OS 10.11, some cocoapods commands to change. If you have a pod setup or pod update problem, and it is difficult to solve, I suggest 10.11. Uninstall reinstall after installation of cocoapods has some different commands, the following summary:
1 check the ruby environment, if necessary, please update as follows
$ sudo gem update --system
2 uninstall cocoapods
$ sudo gem uninstall cocoapods
3 reinstall cocoapods (Setup command has changed)
Before 10.11
$ sudo gem install cocoapods
After 10.11
$ sudo gem install -n /usr/local/bin cocoa pods
4
$ sudo chmod +rx /usr/local/bin
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
//taking CocoaPods Specs repository copy to your computer under directory ~/.cocoapods
pod setup
来源:https://stackoverflow.com/questions/39686706/cocoapods-error-rpc-failed-curl-18-transfer-closed-with-outstanding-read-data