我用如下命令下载文件的时候没有成功:
curl https://raw.githubusercontent.com/mojombo/grit/master/lib/grit/repo.rb > repo.rb
repo.rb里面没有期望中的内容,而是字符串“Not Found”
从网上搜索解决方法,有说添加-JLO选项,结果无用。 后来找到一篇文章说原因是无法解析域名raw.githubusercontent.com,解决方法是通过whatismyipaddress站点用域名来查ip,
把任意一条ip地址加入C:\Windows\System32\drivers\etc\hosts文件后就能ping通raw.githubusercontent.com了。
后来从网上找到另一个更好的方法,就是这篇文章里说的:找不到 raw.githubusercontent.com 的服务器 IP 地址-有效解决办法,先从阿里云平台查找githubusercontent.com注册的DNS服务器地址,再用该地址修改本地网络DNS服务器地址,最后ipconfig /flushdns 刷新本地DNS缓存,之后就可以ping通raw.githubusercontent.com了