Mat*_*rts 17 ruby rvm osx-mavericks
我刚刚升级到osx mavericks,我想安装ruby 2.0,但是我遇到了configure: error: cannot run C compiled programs.错误.
我更新rvm rvm get stable然后键入rvm install 2.0.0并得到一个错误,指示我一个日志文件.日志文件包含:
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/mattroberts/.rvm/src/ruby-2.0.0-p247':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
所以,我尝试列出我拥有的版本.它告诉我,1.9.3-p392所以我卸载那个并重新安装,看看是否有效 - 同样的错误.
我是否需要重新安装/更新xcode,还是有其他解决方案?
谢谢!
fsa*_*via 54
如果您在升级到Mavericks之后尚未升级Xcode,则应该这样做之后,打开命令提示符并键入:
xcode-select --install
这将安装已被OSX更新删除的xcode命令工具.之后它应该工作正常.
mml*_*lac 29
建议的解决方案没有解决我的问题(最新版本的XCode,安装了命令行工具).我用过rvm install ruby-1.9.3 --with-gcc=clang,而且有用了.
我以为rvm默认使用clang for OSX.不确定我是否记得那个错误或改变了什么/这不再是最好的事情.然而它使我的安装工作.
在Edu的评论之后,他引用的github rvm问题页面警告:
@marksands请确定你知道你是什么,ruby 1.9.3用clang编译不是"安全",它可以段错误,线程相关的问题是可以预料的,考虑重新安装ruby --with-gcc = gcc42或者只是让rvm安装gcc 4.6,只有ruby 2.0.0与clang完全兼容
这个问题指出了小牛队的gcc46问题:
有问题的宝石使用不同的语言 - 不是C/C++,它使用Objective-C - 所以它不是编译器的错误,你可以构建gcc-4.6并支持Objective-C - 它默认情况下没有完成.
你现在有两个选择,都是从uninstallig gcc-4.6开始,然后是:
•安装apple-gcc42
•使用--enable-objc安装gcc-4.6
这应该是固定的,运行:
rvm get head
rvm remove 1.9.3
rvm install 1.9.3
不要使用额外的标志