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 地址

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

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)"

Failed to connect to raw.githubusercontent.com port 443: Connection refused

 

 

4.终端输入

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

然后再次输入flutter doctor

Failed to connect to raw.githubusercontent.com port 443: Connection refused

 

 

 

 

终端输入

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

Failed to connect to raw.githubusercontent.com port 443: Connection refused

 

 

 

 

 

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

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/310005.html

(0)
上一篇 2023年12月13日 11:49
下一篇 2023年12月17日 15:19

相关推荐

发表回复

登录后才能评论