1 遇到的问题

我需要在macOS系统上安装OhMyZsh。
根据oh my zsh的README,我的环境满足它的所有Prerequisites

根据文档,运行命令:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

报错:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

执行另一条命令:

sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

报错:

正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)… 0.0.0.0
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443… 失败:Connection refused。

显然,问题是机器连不上raw.githubusercontent.com这个站点的443端口,443端口是用于HTTP服务的。

2 解决方案

查了github上的相关issue, 找到了解决方案:https://github.com/ohmyzsh/ohmyzsh/issues/8515

其中有一条评论是这么说的:

If this turns out to be a Great Firewall of China issue, I stronly advise against using an unknown site instead, especially if you want to download things that you’re going to run later, as is the case.

Instead, given that you can visit github.com, try downloading the ZIP of the repository (press the “Clone or download” button, then “Download ZIP”). Or you can try to git-clone the repository. You can also access the web UI of the install script and copy-paste the contents of it into an install.sh script and run that.

根据评论,我在不开启科学上网的情况下,访问https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
在这里插入图片描述
开启科学上网后访问https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
在这里插入图片描述
这说明raw.githubusercontent.com这个站点是被墙的。

在开启科学上网的情况下,我将要下载的文件: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh,copy & paste进一个XX.sh文件(记得给XX.sh加可执行权限), 然后执行XX.sh。

成功执行脚本!!on my zsh成功安装!!
在这里插入图片描述
以上

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐