简体   繁体   English

Xcode 8命令行工具缺失(Git,Clang等)

[英]Xcode 8 Command Line Tools Missing (Git, Clang, etc)

Two days ago, I upgraded to OSX Sierra. 两天前,我升级到OSX Sierra。 My development tools seemed to be working fine after that. 之后我的开发工具似乎工作得很好。

However, today I upgraded Xcode 7.3.1 -> 8.1 to make certain features work for React-Native development. 但是,今天我升级了Xcode 7.3.1 - > 8.1,使某些功能适用于React-Native开发。 To be precise, I deleted the 7.3.1 and installed 8.1 anew. 确切地说,我删除了7.3.1并重新安装了8.1。 That is where the woes had started. 这就是困境开始的地方。

In particular, it seems that most of the Command Line Tools are gone. 特别是,似乎大多数命令行工具都没了。 I get errors when trying to use git as well as other commands. 尝试使用git以及其他命令时出错。 I was able to get Git back after installing from .dmg file. 从.dmg文件安装后我能够恢复Git。

I have also tried installing Command Line Tools using xcode-select --install to no avail. 我也尝试使用xcode-select --install安装命令行工具无济于事。 Installation proceeds, but none of the tools become available afterwards. 安装继续进行,但之后没有任何工具可用。

As an example of what is happening, the following are the errors I receive when running: curl -sSL https://get.rvm.io | bash -s stable --ruby 作为正在发生的事情的一个例子,以下是我在运行时收到的错误: curl -sSL https://get.rvm.io | bash -s stable --ruby curl -sSL https://get.rvm.io | bash -s stable --ruby

xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk" cannot be located.
gcc: error: unable to find utility "gcc", not a developer tool or in PATH
configure: error: clang version 3.0 or later is required

Does someone know what the issue might be and how one goes about getting the development environment set up on Sierra + Xcode 8.1? 有人知道问题可能是什么以及如何在Sierra + Xcode 8.1上设置开发环境?

The problem is that you need to repoint the command line tools to the new copy of Xcode. 问题是您需要将命令行工具重新命名为Xcode的新副本。 You can use xcode-select to do that, but the easiest way is, in Xcode, go to Preferences > Locations and choose the correct Xcode for the Command Line Tools pop-up menu at the bottom. 您可以使用xcode-select来执行此操作,但最简单的方法是,在Xcode中,转到“首选项”>“位置”,然后在底部的“命令行工具”弹出菜单中选择正确的Xcode。

Also pls note that in order to use xcode-select you need to use sudo . 另请注意,为了使用xcode-select您需要使用sudo

This error occurred after installing the new version of Xcode. 安装新版本的Xcode后发生此错误。

Just restarting helped for me. 刚重启对我有帮助。 Sometimes, even quitting and restarting Terminal might also help. 有时,即使退出并重新启动终端也可能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM