Failed to build Ruby 1.9.3 on Lion

After switching to Lion (and rebuilding my system from scratch), I decided to try rbenv in this process. Unfortunately, I have not been able to get Ruby 1.9.3 to compile since switching, and now I'm stuck using Ruby I, compiled at the same time on Snow Leopard. I hope someone can notice that this is still eluding me. Here are the assumptions I used when:

What I have tried so far:

  • Manual assembly

     ./configure && make && make install 
  • Giving ruby-build do # 1. for me.

     rbenv install -v 1.9.3-p286 
  • Compiling with a apple-gcc42 LLVM compiler (via installing apple-gcc42 Homebrew)

     CC=/usr/local/bin/gcc-4.2 rbenv install -v 1.9.3-p286 
  • Trying the shared option as it worked on Snow Leopard

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

And each time the assembly fails in the same obscure way: through non-existent tests and failures, Array related tests:

 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 completely)

I use the latest version (October 2012) of the command line tools for Xcode, but not Xcode itself. Relevant component versions are:

 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 

In addition to what I tried above, I also searched the Internet to no avail.

+4
source share
1 answer

I had the same problem. In my case, I added . into your CDPATH (via export CDPATH=.:$CDPATH ) and was able to get ruby ​​to build through rbenv install. I recently worked on CDPATH, so it is possible (even likely) that I myself caused this problem.

+14
source

Source: https://habr.com/ru/post/1439678/


All Articles