1

我在 RVM for OS X 10.8 中安装 JRuby 时遇到错误,尝试安装时终端输出如下:

$ rvm install jruby --debug
jruby - install
jruby-1.7.0 - #downloading jruby-bin-1.7.0, this may take a while depending on your connection...
[2012-11-01 00:09:16] /usr/local/rvm/scripts/fetch http://jruby.org.s3.amazonaws.com/downloads/1.7.0/jruby-bin-1.7.0.tar.gz
current path: /usr/local/rvm/src
command(2): /usr/local/rvm/scripts/fetch http://jruby.org.s3.amazonaws.com/downloads/1.7.0/jruby-bin-1.7.0.tar.gz
jruby-1.7.0 - #extracting jruby-bin-1.7.0 to /usr/local/rvm/src/jruby-1.7.0
[2012-11-01 00:09:17] tar xzf /usr/local/rvm/archives/jruby-bin-1.7.0.tar.gz -C /usr/local/rvm/tmp/rvm_src_80980
current path: /usr/local/rvm/src
command(5): tar xzf /usr/local/rvm/archives/jruby-bin-1.7.0.tar.gz -C /usr/local/rvm/tmp/rvm_src_80980
jruby-1.7.0 - #extracted to /usr/local/rvm/src/jruby-1.7.0
jruby-1.7.0 - #nailgun
[2012-11-01 00:09:18] jruby_install_build_nailgun
jruby_install_build_nailgun () 
{ 
    typeset _result;
    set -x;
    chpwd_functions="" builtin cd "${rvm_src_path}/$rvm_ruby_string/tool/nailgun" && case "$rvm_ruby_version" in 
        1.2* | 1.3*)
            true
        ;;
        *)
            env "${rvm_configure_env[@]}" ./configure --prefix=$rvm_ruby_home
        ;;
    esac && make "${rvm_make_flags[@]}";
    _result=$?;
    set +x;
    return $_result
}
current path: /usr/local/rvm/src/jruby-1.7.0
command(1): jruby_install_build_nailgun
Error running 'jruby_install_build_nailgun', please read /usr/local/rvm/log/jruby-1.7.0/nailgun.log

nailgun.log 如下所示:

[2012-11-01 00:09:18] jruby_install_build_nailgun
jruby_install_build_nailgun () 
{ 
    typeset _result;
    set -x;
    chpwd_functions="" builtin cd "${rvm_src_path}/$rvm_ruby_string/tool/nailgun" && case "$rvm_ruby_version" in 
        1.2* | 1.3*)
            true
        ;;
        *)
            env "${rvm_configure_env[@]}" ./configure --prefix=$rvm_ruby_home
        ;;
    esac && make "${rvm_make_flags[@]}";
    _result=$?;
    set +x;
    return $_result
}
current path: /usr/local/rvm/src/jruby-1.7.0
command(1): jruby_install_build_nailgun
++ chpwd_functions=
++ builtin cd /usr/local/rvm/src/jruby-1.7.0/tool/nailgun
++ case "$rvm_ruby_version" in
++ env 'LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include' ./configure --prefix=/usr/local/rvm/rubies/jruby-1.7.0
checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.
++ _result=77
++ set +x

所以看起来调用configure有问题,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 ng configure 0.7.1, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure --prefix=/usr/local/rvm/rubies/jruby-1.7.0

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

hostname = #####.local
uname -m = x86_64
uname -r = 12.2.0
uname -s = Darwin
uname -v = Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64

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

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 8.00 gigabytes
Default processor set: 146 tasks, 748 threads, 2 processors
Load average: 6.21, Mach factor: 0.29
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/rvm/gems/ruby-1.9.3-p194/bin
PATH: /usr/local/rvm/gems/ruby-1.9.3-p194@global/bin
PATH: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin
PATH: /usr/local/rvm/bin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /opt/sm/bin
PATH: /opt/sm/pkg/active/bin
PATH: /opt/sm/pkg/active/sbin


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

configure:1734: checking for gcc
configure:1750: found /usr/bin/gcc
configure:1761: result: gcc
configure:1999: checking for C compiler version
configure:2006: gcc --version >&5
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 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:2009: $? = 0
configure:2016: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
configure:2019: $? = 0
configure:2026: gcc -V >&5
llvm-gcc-4.2: argument to `-V' is missing
configure:2029: $? = 1
configure:2052: checking for C compiler default output file name
configure:2079: gcc   -L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include conftest.c  >&5
i686-apple-darwin11-llvm-gcc-4.2: CFLAGS=-I/opt/sm/pkg/active/include: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: CPATH=/opt/sm/pkg/active/include: No such file or directory
configure:2082: $? = 1
configure:2120: result: 
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "ng"
| #define PACKAGE_TARNAME "ng"
| #define PACKAGE_VERSION "0.7.1"
| #define PACKAGE_STRING "ng 0.7.1"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2127: error: C compiler cannot create executables
See `config.log' for more details.

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

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_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_ac_ct_CC=gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

CC='gcc'
CFLAGS=''
CPP=''
CPPFLAGS=''
DEFS=''
ECHO_C='ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
LDFLAGS='-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include'
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='ng'
PACKAGE_STRING='ng 0.7.1'
PACKAGE_TARNAME='ng'
PACKAGE_VERSION='0.7.1'
PATH_SEPARATOR=':'
SHELL='/bin/sh'
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local/rvm/rubies/jruby-1.7.0'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "ng"
#define PACKAGE_TARNAME "ng"
#define PACKAGE_VERSION "0.7.1"
#define PACKAGE_STRING "ng 0.7.1"
#define PACKAGE_BUGREPORT ""

configure: exit 77

有人知道发生了什么吗?尝试了几个小时环顾不同的论坛,但没有运气。谢谢。

4

2 回答 2

2

it is not required to build nailgun in jruby 1.7.0, you can use rvm head where this step was already removed:

rvm get head
rvm reinstall jruby
于 2012-11-01T15:04:52.230 回答
0

我已经成功地用 mac osx 10.8 安装了 jruby,没有任何问题。

$ rvm install jruby
jruby-1.7.0 - #downloading jruby-bin-1.7.0, this may take a while
depending on your connection... jruby-1.7.0 - #extracting
jruby-bin-1.7.0 to /Users/guy/.rvm/src/jruby-1.7.0 jruby-1.7.0 -
extracted to /Users/guy/.rvm/src/jruby-1.7.0 jruby-1.7.0 - #nailgun jruby-1.7.0 -    #installing to /Users/guy/.rvm/rubies/jruby-1.7.0
jruby-1.7.0 - #importing default gemsets (/Users/guy/.rvm/gemsets/)

似乎配置失败,这可能是您的 gcc 已过时或由于某种原因无法正常工作。您是否安装了 Xcode 并添加了命令行工具?这应该可以解决您的 gcc 问题。如果您不想安装 Xcode,您可以使用 homebrew 或类似软件安装 gcc。

于 2012-11-01T13:25:49.770 回答