安装ruby报错,unable to access ‘https://github.com/Homebrew/brew/

安装ruby报错

Mac安装Homebrew的时候报错误fatal: unable to access ‘https://github.com/Homebrew/brew/’

抛出异常

fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
Failed during: /usr/local/bin/brew update --force

执行安装命令:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

现象:

zyp@zypdeMacBook-Pro ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew

Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R zyp:admin /opt/homebrew
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Failed during: git fetch --force origin

解决:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

现象:

 开始执行Brew自动安装程序
              [[email protected]]
           ['2022-04-08 17:04:27']['12.2']
        https://zhuanlan.zhihu.com/p/111014448


请选择一个下载镜像,例如中科大,输入1回车。
源有时候不稳定,如果git克隆报错重新运行脚本选择源。cask非必须,有部分人需要。
1、中科大下载源 2、清华大学下载源 3、北京外国语大学下载源  4、腾讯下载源(不推荐) 5、阿里巴巴下载源(不推荐 缺少cask源)

请输入序号: 2

然后等着。。等着。。中途需要输入几次开机密码

你可能感兴趣的:(安装ruby报错,unable to access ‘https://github.com/Homebrew/brew/)