Clang 1.6版无法更新

时间:2015-01-12 11:30:55

标签: xcode clang llvm homebrew rbenv

我对clang有一个非常奇怪的问题。我正在运行OSX 10.10.1并从here安装了XCode 6.1.1。对于另一个项目,我想通过rbenv install 2.2.0将Ruby从2.1.2更新到2.2.0。该命令输出以下错误:

Downloading ruby-2.2.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...

BUILD FAILED (OS X 10.10.1 using ruby-build 20141225)

Inspect or clean up the working tree at /var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502
Results logged to /var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502.log

Last 10 log lines:
Via: 1.1 2ce6276171358bf7d052aa190ed98f8d.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 42q6Sa73ORpGbCgaHIpsBwTRP8ycUAhsdTolikEbyxqMrn9uePtfCA==

/var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502/ruby-2.2.0 /var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502 /usr/bin
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... x86_64-apple-darwin14.0.0
checking target system type... x86_64-apple-darwin14.0.0
clang: error: invalid version number in '-mmacosx-version-min=10.10.0'
configure: error: clang version 3.0 or later is required
make: *** No targets specified and no makefile found.  Stop.

用Google搜索invalid version number in '-mmacosx-version-min=10.10.0',但我没有找到任何有用的信息。通过运行clang --version,我发现我的clang可执行文件是版本1.6(!):

Apple clang version 1.6 (tags/Apple/clang-70)
Target: x86_64-apple-darwin14
Thread model: posix

这似乎很奇怪,因为XCode is usually shipped with LLVM 6。我尝试(重新)安装命令行工具(其中应该包含clang),但XCode没有为我提供下载/更新它们的选项:No Option to Download CLT

尝试通过命令行通过xcode-select安装它们:xcode-select --install按建议here显示帮助消息,表明--install-command未知(xcode-select是版本895)。我也试过download and install it manually,但它绝对没有效果。 xcode-select-path是/Applications/Xcode.app/Contents/Developer,但我也尝试了/Applications/Xcode.app

我也试过update clang via Homebrew

$ brew install llvm --with-clang --with-asan 
[...]
LLVM executables are installed in /usr/local/opt/llvm/bin.
Extra tools are installed in /usr/local/opt/llvm/share/llvm.
$ brew install llvm --with-clang --with-asan
Warning: llvm-3.5.0_2 already installed

但是这两个路径中没有一个是clang可执行文件。

所以我的问题是:有没有办法更新clang?或者安装ruby 2.2.0的解决方法呢?我被困在这里好几天了,非常感谢任何帮助!

修改

我发现较新的XCode版本(我认为从5.0开始)在XCode.app文件夹中附带了LLVM / Clang。几个月前,我安装了XCode 4.something用于测试目的 - 这些版本覆盖了像clang和xcode-select这样的系统工具。重新安装XCode 6将不会更新它们。

我通过从另一台Mac复制/ usr / bin来修复它,但必须有一种方法可以修复它而不需要这种解决方法。

0 个答案:

没有答案