pod install 安装bugly时报错
[!] Error installing Bugly
[!] /usr/bin/curl -f -L -o /var/folders/6l/t2dwpz4n27v8954sbchm7rb80000gn/T/d20211230-26349-1xx9psc/file.zip https://raw.githubusercontent.com/BuglyDevTeam/Bugly-iOS/master/release/Bugly-2.5.2.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.2 cocoapods-downloader/1.5.1'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
解决方法:查询 raw.githubusercontent.com IP地址,加入hosts文件即可。
详细步骤:
1、 打开IP查询网址:https://www.ipaddress.com
2、输入 raw.githubusercontent.com 查询其IP地址
3、前往文件夹 /etc, 找到hosts 文件
4、hosts文件是被锁定的,所以复制一份到桌面
5、修改hosts,在最底下添加刚才的ip 和 raw.githubusercontent.com(例:199.232.68.133 raw.githubusercontent.com)
6、保存,将此编辑过的文件拖到/etc目录下, 替换之前的文件
7、重新执行pod install命令 即可
参考文章
https://www.jianshu.com/p/2cdecb181a95
之后又遇到一个类似错误
[!] Error installing CocoaLumberjack
[!] /usr/bin/git clone https://github.com/CocoaLumberjack/CocoaLumberjack.git /var/folders/6l/t2dwpz4n27v8954sbchm7rb80000gn/T/d20211230-26547-5q58kr --template= --single-branch --depth 1 --branch 3.6.1
Cloning into '/var/folders/6l/t2dwpz4n27v8954sbchm7rb80000gn/T/d20211230-26547-5q58kr'...
fatal: unable to access 'https://github.com/CocoaLumberjack/CocoaLumberjack.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
查询了解决方法,本来想找一个靠谱的先试,突发奇想,不修改再pod install 试几次会不会好,然后就试了,哎 ,竟然真的OK,直接过
后续又遇到几次,还是老方法,多试几次,OKOKOK,哈哈哈
三、
有一个新问题
[!] Error installing RegexKitLite
[!] Unable to locate the executable `svn`
原因:
新电脑,终端里pod install 某些老的库, 比如RegexKitLite这些,会报错Unable to locate the executable ‘svn’ , 因为新电脑里没有安装svn,xcode不自带svn了。
解决:
安装svn 再pod install即可
步骤:
//打开终端输入 brew install svn
如果没有安装Homebrew,复制下方内容 终端执行即可安装
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
参考
https://blog.youkuaiyun.com/RollingPin/article/details/117445813
https://blog.youkuaiyun.com/RollingPin/article/details/117445015
https://blog.youkuaiyun.com/RollingPin/article/details/117444183
https://zhuanlan.zhihu.com/p/111014448