CocoaPods在pod install时 报错Error installing xxx [!] /usr/bin/git clone https://github.com/rs/xxx.gi...

pod install 报错解决办法

错误信息:

Error installing 库名

[!] /usr/bin/git clone https://github.com/rs/xxx.git /var/folders/8p/r8g_lkd578d90pq7h_mnv2ww0000gn/T/d20210918-72433-1y3o2eq --template= --single-branch --depth 1 --branch 3.8.3

Cloning into '/var/folders/8p/r8g_lkd578d90pq7h_mnv2ww0000gn/T/d20210918-72433-1y3o2eq'...

fatal: unable to access 'https://github.com/rs/xxx.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

解决办法:(前提是你有翻墙小软件[坏笑] 我的是Shadowsocks)

设备信息:mac  big sur 11.2.3

 1、打开网络 偏好设置——高级——找到如图参数 (这些参数也和你的代理工具设置有关,可以根据自己实际情况修改)


2、命令行执行

    方式1: git设置全局代理,所有的git拉取走这个代理

        git config --global http.proxy SOCKS://127.0.0.1:7890

    方式2: 如果需要国内git库不走代理,而是只需要github上的代码库走代理,就可以这样设置

        git config --globalhttp.https://github.com.proxy SOCKS://127.0.0.1:7890

3、在项目执行

    pod install

到此,配置完成,实测有效,执行速度杠杠的。


注:题外话

1、取消代理的两种方式,对应上面设置代理的方式:

    方式1:同时这种方式会取消所有在git global配置的代理

    git config --global --unset http.proxy

    方式2:

    git config --global --unset http.https://github.com.proxy

2、查看git的配置

    config 配置指令

    1、git config

    config 配置有system级别 global(用户级别) 和local(当前仓库)三个,git在查找设置顺序 system ->global -> local  配置依次覆盖, 查看对应的配置文件

    查看系统config

        git config --system --list

    查看当前用户(global)配置

        git config --global  --list

    查看当前仓库配置信息   

        git config --local --list

你可能感兴趣的:(CocoaPods在pod install时 报错Error installing xxx [!] /usr/bin/git clone https://github.com/rs/xxx.gi...)