无法在Lion上构建Ruby 1.9.3

Gar*_*ams 4 ruby macos osx-lion

在切换到Lion(并从头开始重建我的系统)后,我决定尝试rbenv在此过程中.不幸的是,自从交换机以来我一直无法编译Ruby 1.9.3并且现在仍然使用我在Snow Leopard上编译的Ruby.我希望有人可以发现任何继续躲避我的事情.以下是我一直在运作的假设:

到目前为止我尝试过的:

  1. 手动构建

    ./configure && make && make install
    
    Run Code Online (Sandbox Code Playgroud)
  2. ruby-build做#1.为了我.

    rbenv install -v 1.9.3-p286
    
    Run Code Online (Sandbox Code Playgroud)
  3. 使用非LLVM编译器进行编译(通过安装apple-gcc42Homebrew包)

    CC=/usr/local/bin/gcc-4.2 rbenv install -v 1.9.3-p286
    
    Run Code Online (Sandbox Code Playgroud)
  4. 尝试shared选项,因为它适用于Snow Leopard

    CONFIGURE_OPTS="--with-shared" rbenv install -v 1.9.3-p286
    
    Run Code Online (Sandbox Code Playgroud)

并且每次构建都以相同,模糊的方式失败:通过不存在的测试和失败的Array相关测试:

configuring win32ole
Failed to configure win32ole. It will not be installed.
configuring zlib
/bin/sh: line 0: cd: ext/-test-/array/resize: No such file or directory
/bin/sh: line 0: cd: ext/-test-/add_suffix: No such file or directory
make[1]: *** [ext/-test-/array/resize/all] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [ext/-test-/add_suffix/all] Error 1
make: *** [build-ext] Error 2
Run Code Online (Sandbox Code Playgroud)

(rbenv登录)

我使用的是Xcode命令行工具的最新版本(2012年10月),但不是Xcode本身.相关组件版本是:

gcc -v
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)

cc -v
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
Run Code Online (Sandbox Code Playgroud)

除了我上面尝试过的,我还搜索了网络无济于事.

小智 14

我有同样的问题.在我的情况下,我添加.到我的CDPATH(通过export CDPATH=.:$CDPATH),并能够通过rbenv安装得到ruby.我最近一直在修补CDPATH所以我可能(甚至可能)自己引起了这个问题.