一、pod update 更新失败
Mac book 中 swift 使用 CocoaPods 管理插件一直正常,但最近用 pod update 时不能更新,出现错误信息
wiukings-MacBook-Pro:JloudOevel wiuking$ pod update --repo-update
Update all pods
Updating local specs repositories
Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`.
You can try adding it manually in `/Users/wiuking/.cocoapods/repos` or via `pod repo add`.
提示要手动添加源 https://github.com/CocoaPods/Specs.git,但我的 profile 文件中己存在。经过努力后通过下列步骤解决了这一问题。
二、解决方法
1.通过ipaddress.com查询github.com域名对应的IP.

点击上图红色区域

当Macbook上的Swift项目使用CocoaPods进行pod update时遇到更新失败,可以通过查询github.com域名的IP,将其添加到hosts文件,并执行特定终端命令来解决。
最低0.47元/天 解锁文章
6542

被折叠的 条评论
为什么被折叠?



