【问题标题】:Unable to build Ruby 1.9.3 on Lion无法在 Lion 上构建 Ruby 1.9.3
【发布时间】:2012-10-14 19:06:38
【问题描述】:

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

到目前为止我已经尝试过:

  1. 手动构建

    ./configure && make && make install
    
  2. ruby-build 做#1。对我来说。

    rbenv install -v 1.9.3-p286
    
  3. 使用非 LLVM 编译器进行编译(通过安装 apple-gcc42 Homebrew 包)

    CC=/usr/local/bin/gcc-4.2 rbenv install -v 1.9.3-p286
    
  4. 尝试使用 shared 选项,因为它适用于 Snow Leopard

    CONFIGURE_OPTS="--with-shared" rbenv install -v 1.9.3-p286
    

每次构建失败时,都会以同样的方式失败:通过不存在的测试和失败,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

rbenv log 全文)

我使用的是 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

除了我上面的尝试之外,我还搜索了网络无济于事。

【问题讨论】:

  • 如果您安装了自制软件,我建议您运行 brew doctor 并尝试修复它所显示的内容。实际上与您的问题无关,但它可以提供帮助。
  • zsh... 我已经配置了我的 CDPATH。

标签: ruby macos osx-lion


【解决方案1】:

我遇到了同样的问题。在我的情况下,我将. 添加到我的CDPATH(通过export CDPATH=.:$CDPATH)并且能够通过rbenv install 来构建ruby。我最近一直在修改 CDPATH,所以有可能(甚至很可能)是我自己造成的。

【讨论】:

  • 这对我来说也是个问题。你到底是怎么想出来的? :) 干得好,先生!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-15
  • 2012-10-07
  • 2012-02-28
相关资源
最近更新 更多