1

我正在尝试安装libroutez git

我安装了所有依赖项。当我尝试运行时./configure(第 2 点),它会出现这些行(我省略了以前的那些与 ruby​​ 无关的行,它们没有显示任何问题)

checking for the mkmf Ruby package... yes
checking for Ruby include path... -e:1: Use RbConfig instead of obsolete and deprecated Config.

-I/Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0
checking for Ruby library path... -e:1: Use RbConfig instead of obsolete and deprecated Config.
-lruby.1.9.1

checking for Ruby site-packages path... -e:1: Use RbConfig instead of obsolete and deprecated Config.
/Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/x86_64-darwin11.4.0
checking ruby extra libraries... -e:1: Use RbConfig instead of obsolete and deprecated Config.

checking consistency of all components of ruby development environment... no
configure: error:
  Could not link test program to Ruby. Maybe the main Ruby library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/ruby/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Ruby package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================

我无法指定找到库的正确路径。如果有帮助,命令gem environment输出

 RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin11.4.0]
  - INSTALLATION DIRECTORY: /Users/giorgio/.rvm/gems/ruby-1.9.3-p194
  - RUBY EXECUTABLE: /Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/giorgio/.rvm/gems/ruby-1.9.3-p194/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/giorgio/.rvm/gems/ruby-1.9.3-p194
     - /Users/giorgio/.rvm/gems/ruby-1.9.3-p194@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

--- mpapis 回答后编辑

该命令输出

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.

该文件包含

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by libroutez configure 0.1.0, which was  
generated by GNU Autoconf 2.61.  Invocation command line was

$ ./configure LDFLAGS=-lruby.1.9.1 CFLAGS=-I/Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1

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

hostname = 192-168-1-5.tpgi.com.au
uname -m = x86_64
uname -r = 11.4.0
uname -s = Darwin
uname -v = Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~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 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-            1699.26.8~1/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3
Primary memory available: 4.00 gigabytes
Default processor set: 69 tasks, 322 threads, 4 processors
Load average: 0.37, Mach factor: 3.62
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/giorgio/.rvm/gems/ruby-1.9.3-p194/bin
PATH: /Users/giorgio/.rvm/gems/ruby-1.9.3-p194@global/bin
PATH: /Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/bin
PATH: /Users/giorgio/.rvm/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin
PATH: /usr/local/git/bin

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

configure:1758: checking for gcc
configure:1774: found /usr/bin/gcc
configure:1785: result: gcc
configure:2023: checking for C compiler version
configure:2030: gcc --version >&5
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.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:2033: $? = 0
configure:2040: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/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-2335.15~25/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 2335.15.00)
configure:2043: $? = 0
configure:2050: gcc -V >&5
llvm-gcc-4.2: argument to `-V' is missing
configure:2053: $? = 1
configure:2076: checking for C compiler default output file name
configure:2103: gcc -I/Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1  -            lruby.1.9.1 conftest.c  >&5
ld: library not found for -lruby.1.9.1
collect2: ld returned 1 exit status
configure:2106: $? = 1
configure:2144: result: 
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "libroutez"
| #define PACKAGE_TARNAME "libroutez"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "libroutez 0.1.0"
| #define PACKAGE_BUGREPORT "libroutez@googlegroups.com"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2151: error: C compiler cannot create executables
See `config.log' for more details.

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

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=set
ac_cv_env_CFLAGS_value=-I/Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_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=set
ac_cv_env_LDFLAGS_value=-lruby.1.9.1
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_PYTHON_VERSION_set=
ac_cv_env_PYTHON_VERSION_value=
ac_cv_env_RUBY_set=
ac_cv_env_RUBY_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. ##
## ----------------- ##

AWK=''
CC='gcc'
CFLAGS='-I/Users/giorgio/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1'
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXFLAGS=''
DEFS=''
ECHO_C='ECHO_N=''
ECHO_T=''
EXEEXT=''
GREP=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LDFLAGS='-lruby.1.9.1'
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
OS=''
PACKAGE_BUGREPORT='libroutez@googlegroups.com'
PACKAGE_NAME='libroutez'
PACKAGE_STRING='libroutez 0.1.0'
PACKAGE_TARNAME='libroutez'
PACKAGE_VERSION='0.1.0'
PATH_SEPARATOR=':'
PYTHON=''
PYTHON_CPPFLAGS=''
PYTHON_EXTRA_LDFLAGS=''
PYTHON_EXTRA_LIBS=''
PYTHON_LDFLAGS=''
PYTHON_SITE_PKG=''
PYTHON_VERSION=''
RUBY=''
RUBY_CPPFLAGS=''
RUBY_EXTRA_LIBS=''
RUBY_LDFLAGS=''
RUBY_SITE_PKG=''
RUBY_VERSION='ruby-1.9.3-p194'
SED=''
SHELL='/bin/sh'
SWIG=''
ac_ct_CC='gcc'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
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='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target=''
target_alias=''
target_cpu=''
target_os=''
target_vendor=''

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

#define PACKAGE_NAME "libroutez"
#define PACKAGE_TARNAME "libroutez"
#define PACKAGE_VERSION "0.1.0"
#define PACKAGE_STRING "libroutez 0.1.0"
#define PACKAGE_BUGREPORT "libroutez@googlegroups.com"

configure: exit 77
4

1 回答 1

0

在 Linux 上使用:

./configure \
  LDFLAGS="$(ruby -rrbconfig -e 'puts  RbConfig::CONFIG["LIBRUBYARG"]')" \
  CFLAGS="-I$(ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]')"

在 OSX 上使用:

./configure \
  LDFLAGS="-L$(ruby -rrbconfig -e 'puts RbConfig::CONFIG["libdir"]')" \
  CFLAGS="-I$(ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]')"
于 2012-06-10T03:24:03.133 回答