由于是mac小白,之前安装了很多次homebrew都安装失败,今天偶然再安装一次居然成功了,下面是安装过程
1. 问题场景
按照网上教程使用以下命令安装homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
但是每次都报错,报错信息为curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation
2. 解决办法
- 先下载
Homebrew文件
百度云 ,提取码: 4eti - 找一个目录存放这个文件,并改名为
homebrew_install.rb
,有时候可能是brew_install.rb
- 测试curl命令是否可以正常使用;
curl
执行结果为:curl: try 'curl --help' or 'curl --manual' for more information,证明curl命令可以正常使用,若不可以,先解决curl的问题再进行下一步;
- 进入homebrew_install.rb所在的文件夹,执行命令即可完成安装
1.进入存放homebrew_install.rb
的目录中,
2.执行ruby homebrew_install.rb
, 根据提示输入电脑密码然后回车 安装就行了 - 安装成功信息
* [new tag] 2.3.0 -> 2.3.0
HEAD is now at aff92b3af Merge pull request #7606 from vitorgalvao/appcast-configuration-match
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 729931, done.
remote: Total 729931 (delta 0), reused 0 (delta 0), pack-reused 729931
Receiving objects: 100% (729931/729931), 295.30 MiB | 1.57 MiB/s, done.
Resolving deltas: 100% (482405/482405), done.
Tapped 2 commands and 5034 formulae (5,302 files, 323.7MB).
Already up-to-date.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
网友评论