Homebrew 说 Xcode 已过时 [英] Homebrew saying Xcode is outdated
问题描述
我正在尝试使用 Homebrew 执行软件包的安装,但是当我尝试运行安装时出现以下错误:
I'm trying to perform an install of a package with Homebrew, but when I try to run the install I am getting the following error:
错误:您的 Xcode (7.3.1) 已过时.请更新到 Xcode 8.0(或将其删除).Xcode 可以从 App Store 更新.
Error: Your Xcode (7.3.1) is outdated. Please update to Xcode 8.0 (or delete it). Xcode can be updated from the App Store.
我想在这台机器上保留 Xcode 7.3.1,因为我在另一台机器上有 Xcode 8,并且正在将这个用于旧项目.
I would like to keep Xcode 7.3.1 on this machine since I have Xcode 8 on another machine, and am using this one for older projects.
我在 SO 上找到了类似的帖子,但是设置 export TRAVIS=1
的推荐解决方案似乎对我不起作用.希望有人有我可以使用的修复或解决方法.以下是我的更多细节:
I have found a similar post on SO, but the recommended solution to set export TRAVIS=1
doesn't seem to work for me. Hoping someone has a fix or a workaround I may use. Here are some more of my specifics:
Xcode 7.3.1
Homebrew 1.0.8-135-g4284b82
macOS Sierra 10.12 (16A323)
如果需要任何其他细节,请告诉我.
If anything other specifics needed, please let me know.
谢谢各位!
推荐答案
所以正如@NicolasMiari 在上面的评论中提到的那样,我的问题的修复最终必须在我的机器上同时安装 Xcode 7 和 Xcode 8.我去了苹果开发者网站,下载了 Xcode 8,保存到我的文档中,然后使用:
So as @NicolasMiari mentioned in a comment above, the fix to my issue ended up having to have both Xcode 7 and Xcode 8 on my machine. I went on the apple developer site, downloaded Xcode 8, saved it to my documents and then used:
sudo xcode-select -switch ~/Documents/Xcode.app/
然后运行我的 brew install,它按预期工作.后来我跑了:
and then ran my brew install which worked as expected. Afterwards I ran:
sudo xcode-select -switch /Applications/Xcode.app/
切换回 Xcode 7.3.1.
to switch back to Xcode 7.3.1.
希望这对其他人有所帮助,并感谢您的建议.
Hope this helps someone else, and thanks for the suggestions.
这篇关于Homebrew 说 Xcode 已过时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!