For well-known reasons, Github is slow to access, causing pod Install to run with an error similar to the following: [!] Error installing SobotKit [!] /usr/local/bin/git clone https://github.com/ZCSDK/SobotKit.git /var/folders/nz/zvr167xs1zx791xd4334hxnh0000gp/T/d20220304-73308-57w6i5 –template= –single-branch –depth 1 –branch 3.0.8 Cloning into ‘/ var/folders/nz/zvr167xs1zx791xd4334hxnh0000gp/T/d20220304-73308-57 w6i5’… fatal: unable to access ‘https://github.com/ZCSDK/SobotKit.git/’: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

The reason for failure

First we need to understand the pod install process. When performing pod install, the program will find Podfile definition from the project of warehouse and address, and in ~ /. Cocoapods/repos/master/Specs directory under the current new warehouse *. Podspec. Json resource files. For example, when pod install SobotKit, first perform MD5 calculation on SobotKit to obtain the abstract, and take the first three digits of MD5 5e7 to create a folder: ~ /. Cocoapods/repos/master/Specs / 5 / e/July/Sobotkit, found in the directory you need version, and then open the *. Podspec. Json to find the source node, The github address is too slow, so how to solve the problem?

Github Acceleration solution

Let me introduce three solutions to github’s slow access and failure.

  1. Github domain name:
  • git config --global url."https://hub.fastgit.org".insteadOf https://github.com
  • git config --global url."https://gitclone.com".insteadOf https://github.com
  • git config --global url."https://github.com.cnpmjs.org".insteadOf https://github.com

You can try each one. It’s not guaranteed to work.

  1. Convert the github repository you need into a Gitee repository, register a Gitee account, and go to gitee.com/projects/im… To import the Github repository. Git Clone with Gitee repository instead of Github address

  2. In source replacement mode, use github. Zhlh6.cn/to obtain the accelerator address.

The solution

The Github acceleration problem can be solved in all three ways. If the first solution works, pod Install will execute successfully. If the first option still fails, you can use the second or third option to replace the *.podspec.json source with the second or third generated source.