configuration:错误:安装Ruby 1.9.3时,C编译器无法创build可执行文件

尝试在Trisquel 6上使用以下命令rvm install 1.9.3安装Ruby 1.9.3时出现以下错误

错误

运行'./configure时出错
 --prefix = / home / joshua / .rvm / rubies / ruby​​-1.9.3-p448 --disable-install-doc --enable-shared',请阅读/home/joshua/.rvm/log/1379507772_ruby-1.9 .3-p448 / configure.log有
运行configure时出错。 停止安装。

我的configure.log显示在下面

 [2013-09-18 20:36:16] ./configure当前path:
 /home/joshua/.rvm/src/ruby-1.9.3-p448命令(4):./configure --prefix = / home / joshua / .rvm / rubies / ruby​​-1.9.3 -p448 --disable- install-doc --enable-shared
检查构build系统types... i686-pc-linux-gnu检查主机系统types... i686-pc-linux-gnu
检查目标系统types... i686-pc-linux-gnu
检查gcc ... gcc
检查C编译器是否工作...不
 configure:error:in`/home/joshua/.rvm/src/ruby-1.9.3-p448':configure:error:C编译器无法创build可执行文件请参阅`config.log'以获取更多详细信息

config.log文件

 This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by configure, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure --prefix=/home/joshua/.rvm/rubies/ruby-1.9.3-p448 --with-gcc=clang --disable-install-doc --enable-shared ## --------- ## ## Platform. ## ## --------- ## hostname = trisquel6 uname -m = i686 uname -r = 3.2.0-52-generic-pae uname -s = Linux uname -v = #0trisquel1 SMP Thu Aug 22 22:04:28 UTC 2013 /usr/bin/uname -p = unknown /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /usr/games PATH: /media/allihave/jdkversions/jdk1.7.0_40/bin PATH: /media/allihave/frameworks/apacheAnt/apache-ant-1.9.2/bin PATH: /media/allihave/frameworks/play/play-2.1.0 PATH: /media/allihave/frameworks/scala-2.10.0/bin PATH: /media/allihave/frameworks/clojure/dev/bin PATH: /opt/lampp/bin PATH: /media/allihave/bashincludes PATH: /media/allihave/bashincludes/google_appengine PATH: /home/joshua/.rvm/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2799: checking build system type configure:2813: result: i686-pc-linux-gnu configure:2881: checking host system type configure:2894: result: i686-pc-linux-gnu configure:2914: checking target system type configure:2927: result: i686-pc-linux-gnu configure:3408: checking for C compiler version configure:3417: clang --version >&5 Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) Target: i386-pc-linux-gnu Thread model: posix configure:3428: $? = 0 configure:3417: clang -v >&5 Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) Target: i386-pc-linux-gnu Thread model: posix configure:3428: $? = 0 configure:3417: clang -V >&5 clang: error: argument to '-V' is missing (expected 1 value) clang: error: no input files configure:3428: $? = 1 configure:3417: clang -qversion >&5 clang: error: no input files configure:3428: $? = 1 configure:3448: checking whether the C compiler works configure:3470: clang conftest.c >&5 configure:3474: $? = 0 configure:3522: result: yes configure:3525: checking for C compiler default output file name configure:3527: result: a.out configure:3533: checking for suffix of executables configure:3540: clang -o conftest conftest.c >&5 configure:3544: $? = 0 configure:3566: result: configure:3588: checking whether we are cross compiling configure:3596: clang -o conftest conftest.c >&5 configure:3600: $? = 0 configure:3607: ./conftest configure:3611: $? = 0 configure:3626: result: no configure:3631: checking for suffix of object files configure:3653: clang -c conftest.c >&5 configure:3657: $? = 0 configure:3678: result: o configure:3682: checking whether we are using the GNU C compiler configure:3701: clang -c conftest.c >&5 configure:3701: $? = 0 configure:3710: result: yes configure:3719: checking whether clang accepts -g configure:3739: clang -c -g conftest.c >&5 configure:3739: $? = 0 configure:3780: result: yes configure:3797: checking for clang option to accept ISO C89 configure:3860: clang -c -g -O2 conftest.c >&5 configure:3860: $? = 0 configure:3873: result: none needed configure:3951: checking for g++ configure:3967: found /usr/bin/g++ configure:3978: result: g++ configure:4005: checking for C++ compiler version configure:4014: g++ --version >&5 g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:4025: $? = 0 configure:4014: g++ -v >&5 Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) configure:4025: $? = 0 configure:4014: g++ -V >&5 g++: error: unrecognized option '-V' g++: fatal error: no input files compilation terminated. configure:4025: $? = 4 configure:4014: g++ -qversion >&5 g++: error: unrecognized option '-qversion' g++: fatal error: no input files compilation terminated. configure:4025: $? = 4 configure:4029: checking whether we are using the GNU C++ compiler configure:4048: g++ -c conftest.cpp >&5 configure:4048: $? = 0 configure:4057: result: yes configure:4066: checking whether g++ accepts -g configure:4086: g++ -c -g conftest.cpp >&5 configure:4086: $? = 0 configure:4127: result: yes configure:4156: checking how to run the C preprocessor configure:4187: clang -E conftest.c configure:4187: $? = 0 configure:4201: clang -E conftest.c conftest.c:10:10: fatal error: 'ac_nonexistent.h' file not found #include <ac_nonexistent.h> ^ 1 error generated. configure:4201: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define CANONICALIZATION_FOR_MATHN 1 | /* end confdefs.h. */ | #include <ac_nonexistent.h> configure:4226: result: clang -E configure:4246: clang -E conftest.c configure:4246: $? = 0 configure:4260: clang -E conftest.c conftest.c:10:10: fatal error: 'ac_nonexistent.h' file not found #include <ac_nonexistent.h> ^ 1 error generated. configure:4260: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define CANONICALIZATION_FOR_MATHN 1 | /* end confdefs.h. */ | #include <ac_nonexistent.h> configure:4289: checking for grep that handles long lines and -e configure:4347: result: /bin/grep configure:4352: checking for egrep configure:4414: result: /bin/grep -E configure:4420: checking whether clang needs -traditional configure:4454: result: no configure:4479: checking whether the linker is GNU ld configure:4491: result: yes configure:4495: checking whether clang -E accepts -o configure:4506: clang -E -o conftest.i conftest.c configure:4506: $? = 0 configure:4515: result: yes configure:4770: checking for ranlib configure:4786: found /usr/local/bin/ranlib configure:4797: result: ranlib configure:4862: checking for ar configure:4878: found /usr/local/bin/ar configure:4889: result: ar configure:5000: checking for as configure:5016: found /usr/local/bin/as configure:5027: result: as configure:5109: checking for objdump configure:5125: found /usr/local/bin/objdump configure:5136: result: objdump configure:5209: checking for objcopy configure:5225: found /usr/local/bin/objcopy configure:5236: result: objcopy configure:5647: checking for nm configure:5663: found /usr/local/bin/nm configure:5674: result: nm configure:5697: checking whether ln -s works configure:5701: result: yes configure:5708: checking whether make sets $(MAKE) configure:5730: result: yes configure:5753: checking for a BSD-compatible install configure:5821: result: /usr/bin/install -c configure:5832: checking for a thread-safe mkdir -p configure:5871: result: /bin/mkdir -p configure:5889: checking for dot configure:5919: result: no configure:5931: checking for doxygen configure:5961: result: no configure:5972: checking for pkg-config configure:5993: found /usr/bin/pkg-config configure:6016: result: pkg-config configure:6026: checking for ANSI C header files configure:6046: clang -c -g -O2 conftest.c >&5 configure:6046: $? = 0 configure:6119: clang -o conftest -g -O2 conftest.c >&5 configure:6119: $? = 0 configure:6119: ./conftest configure:6119: $? = 0 configure:6130: result: yes configure:6143: checking for sys/types.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for sys/stat.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for stdlib.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for string.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for memory.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for strings.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for inttypes.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for stdint.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6143: checking for unistd.h configure:6143: clang -c -g -O2 conftest.c >&5 configure:6143: $? = 0 configure:6143: result: yes configure:6156: checking minix/config.h usability configure:6156: clang -c -g -O2 conftest.c >&5 conftest.c:53:10: fatal error: 'minix/config.h' file not found #include <minix/config.h> ^ 1 error generated. configure:6156: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define CANONICALIZATION_FOR_MATHN 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include <stdio.h> | #ifdef HAVE_SYS_TYPES_H | # include <sys/types.h> | #endif | #ifdef HAVE_SYS_STAT_H | # include <sys/stat.h> | #endif | #ifdef STDC_HEADERS | # include <stdlib.h> | # include <stddef.h> | #else | # ifdef HAVE_STDLIB_H | # include <stdlib.h> | # endif | #endif | #ifdef HAVE_STRING_H | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | # include <memory.h> | # endif | # include <string.h> | #endif | #ifdef HAVE_STRINGS_H | # include <strings.h> | #endif | #ifdef HAVE_INTTYPES_H | # include <inttypes.h> | #endif | #ifdef HAVE_STDINT_H | # include <stdint.h> | #endif | #ifdef HAVE_UNISTD_H | # include <unistd.h> | #endif | #include <minix/config.h> configure:6156: result: no configure:6156: checking minix/config.h presence configure:6156: clang -E conftest.c conftest.c:20:10: fatal error: 'minix/config.h' file not found #include <minix/config.h> ^ 1 error generated. configure:6156: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define CANONICALIZATION_FOR_MATHN 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include <minix/config.h> configure:6156: result: no configure:6156: checking for minix/config.h configure:6156: result: no configure:6177: checking whether it is safe to define __EXTENSIONS__ configure:6195: clang -c -g -O2 conftest.c >&5 configure:6195: $? = 0 configure:6202: result: yes configure:6234: checking for cd using physical directory configure:6249: result: cd -P configure:6287: checking whether -Wno-unused-parameter is accepted configure:6310: clang -c -g -O2 -Wno-unused-parameter conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wno-parentheses is accepted configure:6310: clang -c -g -O2 -Wno-parentheses conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wno-long-long is accepted configure:6310: clang -c -g -O2 -Wno-long-long conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wno-missing-field-initializers is accepted configure:6310: clang -c -g -O2 -Wno-missing-field-initializers conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wpointer-arith is accepted configure:6310: clang -c -g -O2 -Wpointer-arith conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wwrite-strings is accepted configure:6310: clang -c -g -O2 -Wwrite-strings conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wdeclaration-after-statement is accepted configure:6310: clang -c -g -O2 -Wdeclaration-after-statement conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wshorten-64-to-32 is accepted configure:6310: clang -c -g -O2 -Wshorten-64-to-32 conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6287: checking whether -Wimplicit-function-declaration is accepted configure:6310: clang -c -g -O2 -Wimplicit-function-declaration conftest.c >&5 configure:6310: $? = 0 configure:6312: result: yes configure:6391: checking whether -Wall -Wextra is accepted configure:6414: clang -c -g -O2 -Wall -Wextra conftest.c >&5 configure:6414: $? = 0 configure:6416: result: yes configure:6439: checking whether -ggdb is accepted configure:6462: clang -c -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -ggdb conftest.c >&5 configure:6462: $? = 0 configure:6464: result: yes configure:6551: clang -c -g -O2 conftest.c >&5 configure:6551: $? = 0 configure:6559: checking whether -fvisibility=hidden is accepted configure:6582: clang -c -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fvisibility=hidden conftest.c >&5 configure:6582: $? = 0 configure:6584: result: yes configure:6731: checking for special C compiler options needed for large files configure:6776: result: no configure:6782: checking for _FILE_OFFSET_BITS value needed for large files configure:6807: clang -c -O3 -ggdb conftest.c >&5 conftest.c:8:23: warning: shift count >= width of type [-Wshift-count-overflow] 

Solutions Collecting From Web of "configuration:错误:安装Ruby 1.9.3时,C编译器无法创build可执行文件"

日志不撒谎! configure.log是我需要找到问题的根源。 问题是这样的:

gcc检查C编译器是否工作…不

简单的答案就是这样

 sudo apt-get install clang && rvm install 1.9.3 --with-gcc=clang 

完美的作品!

我解决了它

 ln -s /usr/bin/gcc /usr/bin/gcc-apple-4.2 

在我的情况下,这个问题是由于定制的LDFLAGS。 我正在编译一个Python包。 因为我的Python安装在一个自定义的位置,所以我不得不临时设置LDFLAGS变量env。 只要我解除这个env变量,问题就消失了。 那么FYI。

安装g++编译器为我解决了这个问题。