Setup completed [!] Unable to fi

2024-02-28  本文已影响0人  _果芒_

最近使用Mac访问github的时候,老是进不去,而且使用cocoapods的时候会出现以下错误

Setup completed
[!] Unable to find a pod with name, author, summary, or description matching 'AFNetworking'

然后参考[晴天ccc
]https://www.jianshu.com/p/89bfad910bff的文章新建了cocoapods的索引库,在执行一下操作时发现还有问题

git clone --depth 1 https://github.com/CocoaPods/Specs.git master

有如下错误:

Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': Failed to connect to github.com port 443 after 75126 ms: Couldn't connect to server

在排除了网络问题和github本身的问题后,只能是自己电脑出现了问题,于是查看了自己电脑的hosts文件


vim /private/etc/hosts

如下图(图中IP是替换后的,之前不是这个,也是无法访问github的原因):


截屏2024-02-29 11.18.53.png

怎么获取github的IP地址呢,方法如下:

  1. 使用站长工具,网址如下:
https://ip.tool.chinaz.com/github.com
  1. 搜索框填入github域名即可


    截屏2024-02-29 11.23.21.png
上一篇 下一篇

猜你喜欢

热点阅读