配置时,CentOS中的RVM Ruby安装失败

时间:2016-07-07 15:04:42

标签: ruby centos rvm

我无法通过RVM在CentOS中安装Ruby的新版本。配置时安装似乎出错。

我尝试过安装不同版本的Ruby,总是得到同样的错误。

我的错误日志

[root@dev src]# rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: redhat/6/x86_64/ruby-1.9.3-p551.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for redhat.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p551, this may take a while depending on your cpu(s)...
ruby-1.9.3-p551 - #downloading ruby-1.9.3-p551, this may take a while depending on your connection...
ruby-1.9.3-p551 - #extracting ruby-1.9.3-p551 to /usr/local/rvm/src/ruby-1.9.3-p551....
ruby-1.9.3-p551 - #applying patch /usr/local/rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p551 - #applying patch /usr/local/rvm/patches/ruby/1.9.3/CVE-2015-1855-p484.patch.
ruby-1.9.3-p551 - #applying patch /usr/local/rvm/patches/ruby/1.9.3/update-autoconf.patch.
ruby-1.9.3-p551 - #applying patch /usr/local/rvm/patches/ruby/ssl_no_ec2m.patch.
ruby-1.9.3-p551 - #configuring..
Error running './configure --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p551 --disable-install-doc --enable-shared',
showing last 15 lines of /usr/local/rvm/log/1467903754_ruby-1.9.3-p551/configure.log
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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/usr/local/rvm/src/ruby-1.9.3-p551':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
There has been an error while running configure. Halting the installation.

的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=/usr/local/rvm/rubies/ruby-1.9.3-p551 --disable-install-doc --enable-shared

## --------- ##
## Platform. ##
## --------- ##

hostname = dev
uname -m = x86_64
uname -r = 2.6.32-431.17.1.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Fri Apr 11 17:27:00 EDT 2014

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /data06/devops/apps/apache-maven-3.3.3/bin
PATH: /home/devops/workspace/apps/node-v0.12.7-linux-x64/bin
PATH: /data05/java/jdk1.7.0_75/bin
PATH: /usr/lib64/qt-3.3/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /home/devops/bin
PATH: /usr/local/rvm/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2800: checking build system type
configure:2814: result: x86_64-pc-linux-gnu
configure:2882: checking host system type
configure:2895: result: x86_64-pc-linux-gnu
configure:2915: checking target system type
configure:2928: result: x86_64-pc-linux-gnu
configure:3153: checking for gcc
configure:3169: found /usr/bin/gcc
configure:3180: result: gcc
configure:3409: checking for C compiler version
configure:3418: gcc --version >&5
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 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:3429: $? = 0
configure:3418: gcc -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
configure:3429: $? = 0
configure:3418: gcc -V >&5
gcc: '-V' option must have argument
configure:3429: $? = 1
configure:3418: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:3429: $? = 1
configure:3449: checking whether the C compiler works
configure:3471: gcc    conftest.c  >&5
configure:3475: $? = 0
configure:3523: result: yes
configure:3526: checking for C compiler default output file name
configure:3528: result: a.out
configure:3534: checking for suffix of executables
configure:3541: gcc -o conftest    conftest.c  >&5
configure:3545: $? = 0
configure:3567: result:
configure:3589: checking whether we are cross compiling
configure:3597: gcc -o conftest    conftest.c  >&5
configure:3601: $? = 0
configure:3608: ./conftest
configure:3612: $? = 0
configure:3627: result: no
configure:3632: checking for suffix of object files
configure:3654: gcc -c   conftest.c >&5
configure:3658: $? = 0
configure:3679: result: o
configure:3683: checking whether we are using the GNU C compiler
configure:3702: gcc -c   conftest.c >&5
configure:3702: $? = 0
configure:3711: result: yes
configure:3720: checking whether gcc accepts -g
configure:3740: gcc -c -g  conftest.c >&5
configure:3740: $? = 0
configure:3781: result: yes
configure:3798: checking for gcc option to accept ISO C89
configure:3861: gcc  -c -g -O2  conftest.c >&5
configure:3861: $? = 0
configure:3874: result: none needed
configure:3952: checking for g++
configure:3968: found /usr/bin/g++
configure:3979: result: g++
configure:4006: checking for C++ compiler version
configure:4015: g++ --version >&5
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 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:4026: $? = 0
configure:4015: g++ -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
configure:4026: $? = 0
configure:4015: g++ -V >&5
g++: '-V' option must have argument
configure:4026: $? = 1
configure:4015: g++ -qversion >&5
g++: unrecognized option '-qversion'
g++: no input files
configure:4026: $? = 1
configure:4030: checking whether we are using the GNU C++ compiler
configure:4049: g++ -c   conftest.cpp >&5
configure:4049: $? = 0
configure:4058: result: yes
configure:4067: checking whether g++ accepts -g
configure:4087: g++ -c -g  conftest.cpp >&5
configure:4087: $? = 0
configure:4128: result: yes
configure:4157: checking how to run the C preprocessor
configure:4188: gcc -E  conftest.c
In file included from /usr/include/bits/posix1_lim.h:157,
                 from /usr/include/limits.h:145,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:122,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:11,
                 from conftest.c:11:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
configure:4188: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4188: gcc -E  conftest.c
In file included from /usr/include/bits/posix1_lim.h:157,
                 from /usr/include/limits.h:145,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:122,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:11,
                 from conftest.c:11:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
configure:4188: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4188: gcc -E -traditional-cpp  conftest.c
In file included from /usr/include/features.h:362,
                 from /usr/include/assert.h:38,
                 from conftest.c:14:
/usr/include/sys/cdefs.h:32: error: #error "You need a ISO C conforming compiler to use the glibc headers"
configure:4188: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4188: gcc -E -traditional-cpp  conftest.c
In file included from /usr/include/features.h:362,
                 from /usr/include/assert.h:38,
                 from conftest.c:14:
/usr/include/sys/cdefs.h:32: error: #error "You need a ISO C conforming compiler to use the glibc headers"
configure:4188: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4188: /lib/cpp  conftest.c
In file included from /usr/include/bits/posix1_lim.h:157,
                 from /usr/include/limits.h:145,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:122,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:11,
                 from conftest.c:11:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
configure:4188: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4188: /lib/cpp  conftest.c
In file included from /usr/include/bits/posix1_lim.h:157,
                 from /usr/include/limits.h:145,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:122,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:11,
                 from conftest.c:11:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
configure:4188: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4227: result: /lib/cpp
configure:4247: /lib/cpp  conftest.c
In file included from /usr/include/bits/posix1_lim.h:157,
                 from /usr/include/limits.h:145,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:122,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:11,
                 from conftest.c:11:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
configure:4247: $? = 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.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4247: /lib/cpp  conftest.c
In file included from /usr/include/bits/posix1_lim.h:157,
                 from /usr/include/limits.h:145,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:122,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h:11,
                 from conftest.c:11:
/usr/include/bits/local_lim.h:39:26: error: linux/limits.h: No such file or directory
configure:4247: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|                    Syntax error
configure:4277: error: in `/usr/local/rvm/src/ruby-1.9.3-p551':
configure:4279: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=

我已经验证过,我安装了cpp。

[root@dev src]# cpp --version
cpp (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 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.

已安装的GCC包

[root@dev src]# yum list | grep gcc
Failed to set locale, defaulting to C
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.
gcc.x86_64                          4.4.7-17.el6           @rhel-x86_64-server-6
gcc-c++.x86_64                      4.4.7-17.el6           @rhel-x86_64-server-6
libgcc.i686                         4.4.7-17.el6           @rhel-x86_64-server-6
libgcc.x86_64                       4.4.7-17.el6           @rhel-x86_64-server-6
compat-gcc-34.x86_64                3.4.6-19.el6           redhatdvdiso
compat-gcc-34-c++.x86_64            3.4.6-19.el6           redhatdvdiso
compat-gcc-34-g77.x86_64            3.4.6-19.el6           redhatdvdiso
gcc-gfortran.x86_64                 4.4.7-17.el6           rhel-x86_64-server-6
gcc-gnat.x86_64                     4.4.7-17.el6           rhel-x86_64-server-6
gcc-java.x86_64                     4.4.7-17.el6           rhel-x86_64-server-6
gcc-objc.x86_64                     4.4.7-17.el6           rhel-x86_64-server-6
gcc-objc++.x86_64                   4.4.7-17.el6           rhel-x86_64-server-6

1 个答案:

答案 0 :(得分:0)

最后修好了。我刚刚运行了“yum update”命令,在输出中我注意到以下行

glibc-headers-2.12-1.80.el6.x86_64 has missing requires of kernel-headers
glibc-headers-2.12-1.80.el6.x86_64 has missing requires of kernel-headers >= ('0', '2.2.1', None)

在此之后,我使用

安装了kernel-header
yum install kernel-header

在此之后,一切正常