Mac -》Failed to connect to raw.githubusercontent.com port 443 after 6 ms: Couldn‘t connect to ser

最近买了台8g的Mac mini电脑,想在上面写flutter代码,但是提示没有找到git工具,百度搜索了一下需要先安装home brew这个工具,但是输入命令行:

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

之后出现了这个提示:

Failed to connect to raw.githubusercontent.com port 443 after 6 ms: Couldn't connect to ser

需要修改host文件。

第一种修改方式使用命令行,比较复杂,大家自行搜索;

第二种是查找修改host文件

1.点击Mac电脑屏幕下面的桌面扩展钨【finder】也就是【访达】,快捷键Shift+Command+G查找文件,输入/etc/hosts,将其复制到桌面,打开hosts文件,

插入 185.199.110.133 raw.githubusercontent.com

 2.保存之后替换之前系统的hosts文件,重新打开终端,再次输入之前的命令行就可下载安装gi t,可以输入命令

gi t --version

查看是否已经安装。

猜你喜欢

转载自blog.csdn.net/xiguoqiang321/article/details/130998893