ruby-build icon indicating copy to clipboard operation
ruby-build copied to clipboard

Fails to install 1.9.2 on Yosemite

Open chrise86 opened this issue 12 years ago • 52 comments

Running rbenv install 1.9.2-p330:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
couldn't understand kern.osversion `14.0.0'
Downloading ruby-1.9.2-p330.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/23ef45fdaecc5d6c7b4e9e2d51b23817fc6aa8225a20f123f7fa98760e8b5ca9
Installing ruby-1.9.2-p330...

BUILD FAILED (OS X 10.10 using ruby-build 20140926)

Inspect or clean up the working tree at /var/folders/f5/10yx8t4j7vx3rx7lff6jfpxr0000gn/T/ruby-build.20141007124752.9733
Results logged to /var/folders/f5/10yx8t4j7vx3rx7lff6jfpxr0000gn/T/ruby-build.20141007124752.9733.log

Last 10 log lines:
couldn't understand kern.osversion `14.0.0'
ld: warning: directory not found for option '-L/Users/chrisedwards/.rbenv/versions/1.9.2-p330/lib'
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
miniruby(17709,0x7fff7c00a300) malloc: *** error for object 0x100801808: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
miniruby(17708,0x7fff7c00a300) malloc: *** error for object 0x100801808: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
make: *** [.rbconfig.time] Abort trap: 6
make: *** Waiting for unfinished jobs....
make: *** [encdb.h] Abort trap: 6

chrise86 avatar Oct 07 '14 11:10 chrise86

Please update your xcode to 6.1.

hsbt avatar Oct 07 '14 11:10 hsbt

Still getting exactly the same :(

chrise86 avatar Oct 07 '14 13:10 chrise86

Really? I can't reproduce your issue with Yosemite and Xcode 6.1 GM.(but I got another gcc issue)

couldn't understand kern.osversion `14.0.0'

It show that your xcode version is old version. Please update latest version of Xcode.

hsbt avatar Oct 07 '14 14:10 hsbt

On Tue, Oct 7, 2014 at 3:10 PM, Chris Edwards [email protected] wrote:

Still getting exactly the same :(

Maybe you can try xcode-select --install?

mislav avatar Oct 07 '14 14:10 mislav

xcode-select --install:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

No updates available...

chrise86 avatar Oct 07 '14 15:10 chrise86

I just tried reinstalling the latest command line tools, Xcode 6.1 beta 3 from Sept 29th and still the same. Previous had the release from Sept 2nd, plus any auto updates from the AppStore...

chrise86 avatar Oct 07 '14 16:10 chrise86

On Yosemite GM 2 with latest Command Line Tools:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
couldn't understand kern.osversion `14.0.0'
Downloading ruby-1.9.2-p330.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/23ef45fdaecc5d6c7b4e9e2d51b23817fc6aa8225a20f123f7fa98760e8b5ca9
Installing ruby-1.9.2-p330...

BUILD FAILED (OS X 10.10 using ruby-build 20140926)

Inspect or clean up the working tree at /var/folders/f5/10yx8t4j7vx3rx7lff6jfpxr0000gn/T/ruby-build.20141007214111.1209
Results logged to /var/folders/f5/10yx8t4j7vx3rx7lff6jfpxr0000gn/T/ruby-build.20141007214111.1209.log

Last 10 log lines:
/usr/local/bin/gcc-4.2 -O3 -Wno-error=shorten-64-to-32  -pipe -I. -I.ext/include/x86_64-darwin14.0.0 -I./include -I. -DRUBY_EXPORT -I/Users/chrisedwards/.rbenv/versions/1.9.2-p330/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -o dmyversion.o -c dmyversion.c
couldn't understand kern.osversion `14.0.0'
/usr/local/bin/gcc-4.2 -O3 -Wno-error=shorten-64-to-32  -pipe -L. -L/Users/chrisedwards/.rbenv/versions/1.9.2-p330/lib  -L/usr/local/lib -Wl,-u,_objc_msgSend   main.o dmydln.o dmyencoding.o dmyversion.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o  dmyext.o -lpthread -ldl -lobjc  -o miniruby
couldn't understand kern.osversion `14.0.0'
ld: warning: directory not found for option '-L/Users/chrisedwards/.rbenv/versions/1.9.2-p330/lib'
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
miniruby(9092,0x7fff7d24f300) malloc: *** error for object 0x100801808: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
encdb.h unchanged
make: *** [.rbconfig.time] Abort trap: 6

chrise86 avatar Oct 07 '14 20:10 chrise86

/usr/local/bin/gcc-4.2

It's not xcode's gcc.

I tried to build 1.9.2 with gcc-4.9 on Yosemite. but it's not completed. It seems that need to fix to ruby-1.9.2. but 1.9.2 is EOL now.

Please use 1.9.3 or 2.0/2.1.

hsbt avatar Oct 08 '14 12:10 hsbt

@chrise86 Users have been experiencing problems with Homebrew's apple-gcc42 being picked up automatically on Yosemite for building newer Ruby versions such as 2.1. It seems like gcc-4.2 just won't do it on Yosemite for some reason and I think the Homebrew team are aware of it. Unfortunately, you probably can't use clang (aka /usr/bin/gcc) for 1.9.2 as it's such an old version of Ruby. You might be out of options unless Homebrew's apple-gcc42 gets updated and starts working again for making Rubies.

mislav avatar Oct 10 '14 22:10 mislav

I installed ruby 2.1.3 on OS X Yosemite GM with help of @gregory's comment to set the value of CC to /usr/bin/gcc on https://github.com/sstephenson/rbenv/issues/610

johnisaac avatar Oct 11 '14 00:10 johnisaac

Reopening this until we have a proper warning inside ruby-build that pre-1.9.3 Rubies are broken on Yosemite with no known workaround for now.

mislav avatar Oct 19 '14 09:10 mislav

is this supposed to enable installation of ruby 1.9.2-pxxx on Yosemite? i'm still unable to do it with it complaining about gcc

BUILD FAILED (OS X 10.10 using ruby-build 20141028-1-gde155dd)

am i missing something?

francescob avatar Oct 29 '14 12:10 francescob

@francescob Yeah it was supposed to fix it. It would help me a lot if you'd shared with us the full error output. For bonus points, share the full build log (from a file) as a Gist. Thanks

mislav avatar Oct 29 '14 14:10 mislav

i'm beginning to think it's more of a home-brew problem since it doesn't even try to build with this message:

rbenv install 1.9.2-p320

ERROR: This package must be compiled with GCC, but ruby-build couldn't
find a suitable `gcc` executable on your system. Please install GCC
and try again.

DETAILS: Apple no longer includes the official GCC compiler with Xcode
as of version 4.2. Instead, the `gcc` executable is a symlink to
`llvm-gcc`, a modified version of GCC which outputs LLVM bytecode.

For most programs the `llvm-gcc` compiler works fine. However,
versions of Ruby older than 1.9.3-p125 are incompatible with
`llvm-gcc`. To build older versions of Ruby you must have the official
GCC compiler installed on your system.

TO FIX THE PROBLEM: Install Homebrew's apple-gcc42 package with this
command: brew tap homebrew/dupes ; brew install apple-gcc42

You will need to install the official GCC compiler to build older
versions of Ruby even if you have installed Apple's Command Line Tools
for Xcode package. The Command Line Tools for Xcode package only
includes `llvm-gcc`.

BUILD FAILED (OS X 10.10 using ruby-build 20141028-1-gde155dd)

but if i try install apple-gcc42 with brew it just says that there's no available formula

francescob avatar Oct 29 '14 14:10 francescob

TO FIX THE PROBLEM: Install Homebrew's apple-gcc42 package with this
command: brew tap homebrew/dupes ; brew install apple-gcc42

Have you tried doing what this suggested to you?

brew tap homebrew/dupes ; brew install apple-gcc42

mislav avatar Oct 29 '14 14:10 mislav

yep

[15:14] ~ ➭  brew tap homebrew/dupes ; brew install apple-gcc42                     2.1.4
Warning: Already tapped!
Error: No available formula for apple-gcc42 
Searching formulae...
Searching taps...
[15:14] ~ ➭      

francescob avatar Oct 29 '14 14:10 francescob

I'm still getting a build failure:

$ rbenv install 1.9.2-p320
Downloading ruby-1.9.2-p320.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/39a1f046e8756c1885cde42b234bc608196e50feadf1d0f202f7634f4a4b1245
Installing ruby-1.9.2-p320...

BUILD FAILED (OS X 10.10 using ruby-build 20141028)

Inspect or clean up the working tree at /var/folders/l0/_plw_97n7_58gh3pw0frb6n40000gp/T/ruby-build.20141029142311.82144
Results logged to /var/folders/l0/_plw_97n7_58gh3pw0frb6n40000gp/T/ruby-build.20141029142311.82144.log

Last 10 log lines:
/usr/local/bin/gcc-4.2 -O3 -Wno-error=shorten-64-to-32  -pipe -L. -L/Users/anthonys/.rbenv/versions/1.9.2-p320/lib  -L/usr/local/lib -Wl,-u,_objc_msgSend   main.o dmydln.o dmyencoding.o dmyversion.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o  dmyext.o -lpthread -ldl -lobjc  -o miniruby
ld: warning: directory not found for option '-L/Users/anthonys/.rbenv/versions/1.9.2-p320/lib'
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
miniruby(89205,0x7fff7733b300) malloc: *** error for object 0x7fc8ca002808: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
miniruby(89206,0x7fff7733b300) malloc: *** error for object 0x7f99d3001a08: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
make: *** [.rbconfig.time] Abort trap: 6
make: *** Waiting for unfinished jobs....
make: *** [encdb.h] Abort trap: 6

Build log here: https://gist.github.com/anthonyjsmith/ebd665736e8b008b455d

anthonyjsmith avatar Oct 29 '14 14:10 anthonyjsmith

@mislav 1.8.7, 1.9.2 and 1.9.2 needs to apple-gcc42, but latest ruby-build can not detect apple-gcc42 on Yosemite. and apple-gcc42 is broken on Yosemite.

In my opinion, ruby-build shouldn't support building to 1.8.7, 1.9.1 and 1.9.2 on Yosemite. It's too hard work.

hsbt avatar Oct 29 '14 14:10 hsbt

@hsbt For what it’s worth, I’ve successfully built Ruby 1.8.7, 1.9.2, and REE on Yosemite using the latest version of ruby-build without any problems.

sferik avatar Oct 29 '14 15:10 sferik

@hsbt I've fixed builds that need apple-gcc42 here: https://github.com/sstephenson/ruby-build/commit/10fd04909d3bf77bb26bf6610dbdd10940e80e09#diff-fdcfb8a18714b33b07529b7d02b54f1dR729

@francescob Well that's bizarre since I have:

$ brew info apple-gcc42
apple-gcc42: stable 4.2.1-5666.3

Did you try brew update?

@anthonyjsmith Sorry to hear that. I will try to reproduce.

mislav avatar Oct 29 '14 15:10 mislav