![为什么我在 Fedora 12 上安装 Ruby 1.9.3 时会出现“错误‘configure:3485:错误:C 编译器无法创建可执行文件’”?](https://linux22.com/image/609870/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E5%9C%A8%20Fedora%2012%20%E4%B8%8A%E5%AE%89%E8%A3%85%20Ruby%201.9.3%20%E6%97%B6%E4%BC%9A%E5%87%BA%E7%8E%B0%E2%80%9C%E9%94%99%E8%AF%AF%E2%80%98configure%EF%BC%9A3485%EF%BC%9A%E9%94%99%E8%AF%AF%EF%BC%9AC%20%E7%BC%96%E8%AF%91%E5%99%A8%E6%97%A0%E6%B3%95%E5%88%9B%E5%BB%BA%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6%E2%80%99%E2%80%9D%EF%BC%9F.png)
尝试在 Fedora 12 上安装 Ruby 1.9.3 时,遵循“在 CentOS 上安装 Ruby 1.9.3 的完整指南“,运行命令时出现以下错误./configure
:
$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/ruby-1.9.3-p194':
configure: error: C compiler cannot create executables
See `config.log' for more details
这里是config.log 的内容。
我尝试以 root 和非 root 身份运行。我在尝试安装的目录中具有权限,并使用 yum 安装以下软件包:
httpd-devel
openssl-devel
zlib-devel
gcc
gcc-c++
curl-devel
expat-devel
gettext-devel
patch
readline
readline-devel
zlib
zlib-devel
libyaml-devel
libffi-devel
make
bzip2
zlib1g
mysql-server
并且做到了yum groupinstall "Development tools"
答案1
其中一件令人好奇的事情是您的日志中的这些行:
/usr/bin/ld: 输入文件“/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../crt1.o”的 i386 架构与 i386:x86-64 输出不兼容 /usr/bin/ld: 输入文件“/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../crti.o”的 i386 架构与 i386:x86-64 输出不兼容 /usr/bin/ld: 输入文件“/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../crtn.o”的 i386 架构与 i386:x86-64 输出不兼容
看起来 32 位和 64 位代码不匹配。