无法安装 Xcode 5 命令行工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20439851/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:24:01  来源:igfitidea点击:

Can't install Xcode 5 command line tools

xcodemacoscommand-lineosx-mavericks

提问by user2938976

Trying to install Command Line Tools on OSX 10.9 Mavericks so that I can install MacPorts after that. It's been a nightmare so far.

尝试在 OSX 10.9 Mavericks 上安装命令行工具,以便之后我可以安装 MacPorts。到目前为止,这是一场噩梦。

First, tried the old way: Xcode -> Preferences -> Downloads and download it from there. It does not appear on that list.

首先,尝试旧方法:Xcode -> Preferences -> Downloads 并从那里下载。它没有出现在该列表中。

Then, I tried the command way:

然后,我尝试了命令方式:

xcode-select --install

The software update software opens up, asks me to install it, I say yes, then a message pops up telling me the software is not available:

软件更新软件打开,让我安装它,我说是,然后弹出一条消息告诉我软件不可用:

http://i.stack.imgur.com/kQHNp.png

http://i.stack.imgur.com/kQHNp.png

So I went to Apple Developer's website and downloaded manually the following file:

所以我去了Apple Developer的网站并手动下载了以下文件:

command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg

I installed it, everything goes fine, no error messages appear. So I think: yes! finally!. But nothing has changed, it looks like nothing has been installed. MacPorts keeps not working, and when I check if CLT has been installed properly like this:

我安装了它,一切正常,没有出现错误消息。所以我想:是的!最后!。但是什么都没有改变,看起来什么都没有安装。MacPorts 一直不工作,当我检查 CLT 是否已正确安装时:

pkgutil --pkg-info=com.apple.pkg.DeveloperToolsCLI

I get this:

我明白了:

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

So as far as the system is concerned, no CLT has been installed.

所以就系统而言,没有安装CLT。

Now I don't know what to do, I've tried everything the Internet could tell me and nothing has worked so far. I'm starting to get a little bit desperate.

现在我不知道该怎么办,我已经尝试了互联网可以告诉我的一切,但到目前为止没有任何效果。我开始有点绝望了。

回答by Rich Trouton

If the Xcode command line tools were installed without the rest of Xcode on Mavericks, the directory location where they are installed has changed to /Library/Developer. If the full Xcode application is installed, the command line tools will be embedded inside /Applications/Xcode.app.

如果在 Mavericks 上安装 Xcode 命令行工具时没有安装其余的 Xcode,则安装它们的目录位置已更改为/Library/Developer。如果安装了完整的 Xcode 应用程序,命令行工具将嵌入在/Applications/Xcode.app 中

For more information on this, please see this post:

有关这方面的更多信息,请参阅此帖子:

http://derflounder.wordpress.com/2013/11/15/xcode-command-line-tools-included-with-xcode-5-0-x-on-mavericks/

http://derflounder.wordpress.com/2013/11/15/xcode-command-line-tools-included-with-xcode-5-0-x-on-mavericks/

You may need to update your PATH values to include a reference for /Library/Developerin order for MacPorts to be able to detect the Xcode command line tools. The MacPorts wiki has a post on updating the PATH values for your shell profile that may help here:

您可能需要更新 PATH 值以包含对/Library/Developer的引用,以便 MacPorts 能够检测 Xcode 命令行工具。MacPorts wiki 有一篇关于更新 shell 配置文件的 PATH 值的帖子,可能对这里有帮助:

https://trac.macports.org/wiki/InstallingMacPorts#RequirementsfortheMacPortsshellenvironment

https://trac.macports.org/wiki/InstallingMacPorts#RequirementsfortheMacPortsshellenvironment