3

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?

tujinqiu
  • 47
  • 1
  • 1
  • 5

2 Answers2

4

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

Tim
  • 1,528
  • 1
  • 11
  • 8
  • Worked for me, referenced you in this question as well: https://stackoverflow.com/a/57153959/2481602 Thanks Tim – MindBlower3 Jul 22 '19 at 21:26
3

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
Elvis Cen
  • 31
  • 4