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

ree-1.8.7-* fails to built on Yosemite

Open paulbeattie opened this issue 12 years ago • 17 comments

I haven't seen an issue opened for this yet but ree-1.8.7 is failing to build on Yosemite. Specifying CC=/usr/local/bin/gcc-4.2 yields the same result. Failure message below and log output: https://gist.github.com/paulbeattie/3b6931c997ee40393c06

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
couldn't understand kern.osversion `14.0.0'
Downloading ruby-enterprise-1.8.7-2012.02.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/ecf4a6d4c96b547b3bf4b6be14e082ddaa781e83ad7f69437cd3169fb7576e42
Installing ruby-enterprise-1.8.7-2012.02...

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

Inspect or clean up the working tree at /var/folders/75/_yb744wd5jd1y2gf4cb4dmg80000gn/T/ruby-build.20141018115238.52997
Results logged to /var/folders/75/_yb744wd5jd1y2gf4cb4dmg80000gn/T/ruby-build.20141018115238.52997.log

Last 10 log lines:
couldn't understand kern.osversion `14.0.0'
/usr/local/bin/gcc-4.2 -g -O2  -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/Users/paulbeattie/.rbenv/versions/ree-1.8.7-2012.02/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c dmydln.c
couldn't understand kern.osversion `14.0.0'
/usr/local/bin/gcc-4.2 -g -O2  -pipe -fno-common    -DRUBY_EXPORT  -L. -L/Users/paulbeattie/.rbenv/versions/ree-1.8.7-2012.02/lib    main.o dmydln.o libruby-static.a -L/opt/local/lib -Wl,-rpath,/Users/paulbeattie/.rbenv/versions/ree-1.8.7-2012.02/lib -L/Users/paulbeattie/.rbenv/versions/ree-1.8.7-2012.02/lib -lsystem_allocator -ldl -lobjc   -o miniruby
couldn't understand kern.osversion `14.0.0'
ld: warning: directory not found for option '-L/opt/local/lib'
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
make: *** [miniruby] Error 1

paulbeattie avatar Oct 18 '14 11:10 paulbeattie

Thanks for reporting. Unfortunately, Ruby versions prior to 1.9.3 (those that rely on gcc-4.2) seem to be broken on Yosemite and we don't know a workaround yet. See #648

mislav avatar Oct 19 '14 09:10 mislav

I installed the REE successfully by adding MACOSX_DEPLOYMENT_TARGET=10.9. Like MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/local/bin/gcc-4.2 rvm install ree

wangadong avatar Oct 19 '14 17:10 wangadong

@wangadong thanks for that tip! It'd be good to have a warning in ruby-build for this but at least it's building now, just something to remember.

paulbeattie avatar Oct 20 '14 14:10 paulbeattie

Thanks @wangadong for the workaround. Does REE built like that actually work for you? What might be potential downsides of setting MACOSX_DEPLOYMENT_TARGET like this?

mislav avatar Oct 21 '14 13:10 mislav

Hi @mislav, it seems that currently there's no downsides for my usage. Everything acts as normal. From my perspective, this MACOSX_DEPLOYMENT_TARGET should be designed for compatibility when compiling in new mac, and I'm not sure what exactly happened in the compiler. I also heard someone has installed ree with rbenv without using this MACOSX_DEPLOYMENT_TARGET thing. But this workaround works for me with rvm.

wangadong avatar Oct 22 '14 03:10 wangadong

@mislav I've not noticed any issues adding when compiling older Rubies, everything works as expected.

paulbeattie avatar Oct 22 '14 08:10 paulbeattie

I can confirm that the following worked for me for 2 legacy applications that run under REE 1.8.7.

$ brew install apple-gcc42
$ MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/local/bin/gcc-4.2 rbenv install ree-1.8.7-2011.03

elspethsoup avatar Oct 22 '14 20:10 elspethsoup

If anyone gets here from the Googles like I did (searching for "couldn't understand kern.osversion `14.0.0'"), I thought I'd mention that @soupmatt's fix also worked for reinstalling 2.0.0-p353. Thanks @soupmatt.

backwardm avatar Oct 22 '14 23:10 backwardm

Came here about the "couldn't understand kern.osversion" issue also - and was able to install legacy REE version like so:

$ MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/local/bin/gcc-4.2 rbenv install ree-1.8.7-2012.02

Thank you @soupmatt

subimage avatar Oct 24 '14 04:10 subimage

Confirmed here as well. Thanks @wangadong

jimmybaker avatar Oct 24 '14 13:10 jimmybaker

Also works for 2.0.0-p247

 MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/local/bin/gcc-4.2 rbenv install 2.0.0-p247

(for those finding this via ${SEARCH_ENGINE} I was getting

num2int.c: In function ‘print_num2ll’:
num2int.c:82: error: expected ‘)’ before ‘PRI_LL_PREFIX’
num2int.c:82: warning: spurious trailing ‘%’ in format
num2int.c:82: warning: spurious trailing ‘%’ in format
num2int.c: In function ‘print_num2ull’:
num2int.c:94: error: expected ‘)’ before ‘PRI_LL_PREFIX’
num2int.c:94: warning: spurious trailing ‘%’ in format
num2int.c:94: warning: spurious trailing ‘%’ in format
ld: warning: directory not found for option '-L/Users/fstelluto/.rbenv/versions/2.0.0-p247/lib'
make[2]: *** [num2int.o] Error 1
make[1]: *** [ext/-test-/num2int/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [build-ext] Error 2

gotofritz avatar Nov 11 '14 14:11 gotofritz

Finally, I use these steps to install ruby 1.8.7 on yosemite: brew install openssl rvm pkg install readline sudo rvm cleanup all sudo rvm reinstall all --force --with-openssl-dir=/usr/local/Cellar/openssl/1.0.1j

hongweikang avatar Nov 28 '14 04:11 hongweikang

I found this through google searching for installation of a more modern Ruby (2.1.5) on OS X 10.10.1 and this worked for me... Using rbenv

MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/bin/gcc rbenv install 2.1.5

tbremer avatar Dec 05 '14 01:12 tbremer

i already had gcc 4.8 installed. adding the 'gcc-4.8' didn't work, this worked for me:

MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/bin/gcc rvm install ruby-1.8.7

bliaxiong avatar Jan 28 '15 16:01 bliaxiong

Setting the deployment target to 10.9 worked for me too.

MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/bin/gcc rbenv install <ruby_version>

juanpaulo avatar Jan 30 '15 02:01 juanpaulo

@juanpaulo Which version of ruby-build do you have? This shouldn't be needed since v20141028 10fd04909d3bf77bb26bf6610dbdd10940e80e09

@bliaxiong You seem to be using RVM not rbenv. You're commenting on the wrong project.

mislav avatar Jan 30 '15 07:01 mislav

@mislav I was using ruby-build 20140702-158-g95373b4. Saw from the commit that the deployment target is already being set, thanks for the info!

juanpaulo avatar Jan 30 '15 13:01 juanpaulo