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

mac版本:

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

 

 执行flutter doctor 显示cocoapods已被安装,但是不能用(not working),于是我根据安装指令安装cocoapods,但是安装错误,显示以下报错

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

 

 

 

1.打开网站https://www.ipaddress.com/,查询一下 raw.githubusercontent.com对应的IP 地址

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

 

2.终端输入sudo vi /etc/hosts,来进行编辑(最新版本没有权限修改hosts文件),输入i进入编辑状态,输入以下内容,然后按esc,最后输入:wq进行保存

199.232.96.133  raw.githubusercontent.com

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

 

 

3.终端输入安装执行,安装 Homebrew

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

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

 

 

4.终端输入

sudo gem install -n /usr/local/bin cocoapods

然后再次输入flutter doctor

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

 

 

 

 

终端输入

 sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
  sudo xcodebuild -runFirstLaunch

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

 

 

 

 

 

 解决方法:参考https://blog.csdn.net/qq_43531694/article/details/106862753

 

 

  

上一篇:windows 查看某个端口是否被占用,被谁占用以及杀死占用的进程


下一篇:CKAD