找出Xcode命令行工具的路径位置

Ale*_*pov 4 ruby xcode command-line-tool rvm

我不想安装整个XCode,所以我只是下载了Xcode的命令行工具.我试图通过rvm安装ruby 1.9.3.但是,rvm抱怨没有选择xcode:

xcode-select:错误:未选择Xcode.使用xcode-select -switch,或查看xcode-select手册页(man xcode-select)以获取更多信息.

我读了xcode-select手册页,我知道如何设置xcode命令行工具的路径,但我不知道它们的安装位置.我怎么找到这个?

我正在使用OS X Mountain Lion.

Mat*_*tW. 15

/usr/bin对于您选择的任何内容,条目只是前面的xcode-select:

$> /usr/bin/clang --version
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Run Code Online (Sandbox Code Playgroud)

独立命令行工具安装在/Library/Developer/CommandLineTools:

$> sudo xcode-select -s /Library/Developer/CommandLineTools
$> ?/usr/bin/clang --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin 
Run Code Online (Sandbox Code Playgroud)


小智 13

这对我有用: sudo xcode-select --reset