C编译器无法在Mac OS Mountain Lion上创建可执行文件 [英] C Compiler cannot create Executables on Mac OS Mountain Lion
问题描述
我浏览了几乎所有页面,所有提示都不能解决问题.我正在运行Mountain Lion,我有Xcode,所有最新的开发人员工具,最新的GCC以及其他所有内容.我正在尝试设置rbenv和ruby-build.一切似乎都正常,但是当我要安装一个版本的ruby时,它说c编译器无法工作,并且无法创建可执行文件.日志的确切最后几行:
I've been through almost every page and all the tips don't fix the problem. I'm running Mountain Lion I've got Xcode, all the latest developer tools the latest GCC and everything. I am trying to set up rbenv and ruby-build. Everything seems to work but when I go to install a version of ruby it says that the c compiler doesn't work and that it can't create executables. The exact last lines of the log:
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/var/folders/zr/gv4jcc_122sfrtpfj5g9prc00000gn/T/ruby-build.20130106144331.1477/yaml-0.1.4':
configure: error: C compiler cannot create executables
我很困惑.日志包含:
configure:3265: /usr/bin/gcc-4.2 -I'/Volumes/Macintosh HD 2/Users/jmart/.rbenv/versions/1.9.3-p327/include' -L'/Volumes/Macintosh HD 2/Users/jmart/.rbenv/versions/1.9.3-p327/lib' conftest.c >&5
i686-apple-darwin11-gcc-4.2.1: HD: No such file or directory
i686-apple-darwin11-gcc-4.2.1: 2/Users/jmart/.rbenv/versions/1.9.3-p327/include': No such file or directory
i686-apple-darwin11-gcc-4.2.1: HD: No such file or directory
i686-apple-darwin11-gcc-4.2.1: 2/Users/jmart/.rbenv/versions/1.9.3-p327/lib': No such file or directory
configure:3269: $? = 1
configure:3307: result: no
更新::注意到高清:没有这样的..."& "2"不这样...我确实在Mac中安装了两个两个驱动器-一个用于用户文件,一个用于sys文件.那是在这里引发错误的原因吗?
UPDATE:: Noticing the "HD: No such..." & "2" No Such... I do have two two Drives installed in my mac - one for user files and one for sys files. Is that what's throwing the error here?
推荐答案
它看起来像配置脚本中的错误,但是不需要重命名该卷.只是建立一个符号链接.我没有Mac,但是应该这样做(以root用户身份):
It looks like a bug in the configure script, but there is no need to rename the volume; just make a symbolic link. I don't have a Mac, but something like this should do it (as root):
cd /Volumes
ln -s 'Macintosh HD2' MacHD2
然后:
./configure --prefix=/Volumes/MacHD2/Users/jmart/.rbenv/versions/1.9.3-p327
这篇关于C编译器无法在Mac OS Mountain Lion上创建可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!