更新到OS X 10.9后,我的macport出现了问题。

我试着按照这个手册https://trac.macports.org/wiki/Migration来修复它们。

但是当我安装命令行工具时:

xcode-select——安装

我收到消息

无法安装该软件,因为它当前不可用 软件更新服务器。

与此同时,我成功地将我的另一台机器升级到OS X 10.9。并且安装的命令行工具没有问题,所以它们必须是可用的。

这里的问题是什么?


当前回答

对于OSX 10.11或更高版本,您可以从这里下载https://developer.apple.com/download/more/。

(已接受答案中的链接不显示El Capitan的命令行工具(OSX 10.11))

其他回答

我遇到了同样的问题,无法安装软件,因为它目前不可从软件更新服务器。您可以尝试以下步骤,以使软件更新启动命令行工具的更新。

Check if Command Line Tools Update is mentioned in your list of softwares to be updated by using following command: softwareupdate -l If Command Line Tools Update is not mentioned in that list, then manually make it part of the list using following command which will create a temporary file: sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress Verify that the list now has the Command Line Tools mentioned by running softwareupdate -l again. Now, press Cmd+Space to initiate Mac's Spotlight Search. Search for Software Update. Start the Software Update. That will show you following kind of dialog for installing the Command Line Tools. Install away the update and be merry. :) Remove the temporary file created in Step 2: sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress.

由于npm gyp错误,我删除了xcode-select -p给出的命令工具目录。

Xcode-select安装文件失败,出现不可用错误。

我运行Xcode应用程序和作为启动的一部分安装的命令工具。

npm工作。

然而,这并没有完全修复工具。我必须使用Xcode -select将路径切换到Xcode应用程序目录中的Developer目录。

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer  

撇开suse。

我必须运行Xcode。app,并同意许可协议

设置:全新的MacBook与Mavericks,然后酝酿安装和其他c/l类型的东西“只是工作”。

我通过进入App Store并安装Xcode解决了这个问题。

这是一个相当大的11GB安装,所以这可能是多余的。但是,作为最后的手段,它似乎已经解决了我的问题。在安装过程中(大约10GB), Mac OS告诉我Xcode的命令行工具有更新。在Xcode完全安装之前,执行这个安装不会修复任何问题。

一旦安装完成,它就应该开始工作了(在您接受许可协议之后)。

如果你在最新的Mac OS X Mavericks上尝试,Xcode 5.x附带了命令行工具

所以请确保你已经安装并更新了Xcode到最新

之后,确保Xcode命令行工具使用这个命令是正确的

xcode-select -p

可能会显示一些路径

/应用程序/ xcode /内容/开发人员

使用switch命令将路径更改为正确的路径:

sudo xcode-select --switch /Library/Developer/CommandLineTools/

这将帮助您将其设置为正确的路径,之后您可以使用上面相同的命令-p来检查它是否设置正确