New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install Ruby 2.1.2 on Yosemite Beta #610

Closed
mdespuits opened this Issue Jul 30, 2014 · 20 comments

Comments

Projects
None yet
@mdespuits
Copy link
Contributor

mdespuits commented Jul 30, 2014

Yosemite Beta is awesome

...except that I cannot install the version of Ruby I want with rbenv.

➜  ~  rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635
Installing ruby-2.1.2...

BUILD FAILED

Log output:

/var/folders/4h/5n1jgttj3n3ct7gs_d95024c0000gn/T/ruby-build.20140730150814.787 ~
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 15096114
Connection: keep-alive
Date: Wed, 30 Jul 2014 14:24:55 GMT
Last-Modified: Fri, 23 May 2014 08:34:23 GMT
ETag: "a5b5c83565f8bd954ee522bd287d2ca1"
Accept-Ranges: bytes
Server: AmazonS3
Age: 20600
X-Cache: Hit from cloudfront
Via: 1.1 4ee5063dc9b3d6f9bda9588d4fd84fe7.cloudfront.net (CloudFront)
X-Amz-Cf-Id: JZy3_gBbTHOifdxDK4-J5wwz6fktWgyP4GsYTy7XBstCj1Xk0hgJAQ==

/var/folders/4h/5n1jgttj3n3ct7gs_d95024c0000gn/T/ruby-build.20140730150814.787/ruby-2.1.2 /var/folders/4h/5n1jgttj3n3ct7gs_d95024c0000gn/T/ruby-build.20140730150814.787 ~
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... x86_64-apple-darwin14.0.0
checking target system type... x86_64-apple-darwin14.0.0
couldn't understand kern.osversion `14.0.0'
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.2 accepts -g... yes
checking for gcc-4.2 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.2 accepts -g... yes
checking how to run the C preprocessor... gcc-4.2 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc-4.2 needs -traditional... no
checking for ld... ld
couldn't understand kern.osversion `14.0.0'
checking whether the linker is GNU ld... no
checking whether gcc-4.2 -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for as... as
checking for objdump... no
checking for gobjdump... no
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for dtrace... dtrace
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... no
configure: error: something wrong with CFLAGS=" -O3 -Wno-error=shorten-64-to-32  "
make: *** No targets specified and no makefile found.  Stop.

@mdespuits mdespuits changed the title Cannot install Ruby 2.1.2 on Yosemite Cannot install Ruby 2.1.2 on Yosemite Beta Jul 30, 2014

@mdespuits

This comment has been minimized.

Copy link
Contributor

mdespuits commented Jul 30, 2014

Turns out, I had my CC environment value set to gcc-4.2 from Homebrew. Doesn't play nicely for some reason, and the default CC env points to the /usr/bin/gcc which works perfectly. Closing.

@mdespuits mdespuits closed this Jul 30, 2014

@christian-smith

This comment has been minimized.

Copy link

christian-smith commented Sep 3, 2014

On my system CC wasn't even set and I don't have gcc installed via homebrew I fixed it by setting CC (export CC=/usr/bin/gcc) and then running rbenv install

@wasimakram

This comment has been minimized.

Copy link

wasimakram commented Sep 15, 2014

@christian-smith CC wasn't set on my machine either thank you for the comment.

@mislav

This comment has been minimized.

Copy link
Member

mislav commented Sep 16, 2014

CC is not supposed to be set by default. Ruby's ./configure process should discover and use a suitable compiler it finds in PATH. Apparently it finds Homebrew's apple-gcc42 and tries to use that but fails. I'm not sure why but this isn't a problem with ruby-build, but with the fact apple-gcc42 on Yosemite might be broken.

Similar: ffi/ffi#347 (comment) Homebrew/legacy-homebrew#32120

@mislav mislav reopened this Sep 16, 2014

@jamonholmgren

This comment has been minimized.

Copy link

jamonholmgren commented Sep 19, 2014

Having the same issue. I use ruby-install but it blew up the same way. I traced it to Ruby's ./configure script which also had the same issue.

The workaround listed above does appear to work: CC=/usr/bin/gcc ruby-install ruby 2.1.3 (for rbenv install too I'm sure).

Ref: postmodern/ruby-install#166

@segiddins

This comment has been minimized.

Copy link

segiddins commented Sep 19, 2014

The workaround listed above does appear to work: CC=/usr/bin/gcc ruby-install ruby 2.1.3

Works for me with rbenv

@jeremy

This comment has been minimized.

Copy link
Member

jeremy commented Sep 23, 2014

Ruby's autoconf picks up my gcc-4.2 (used for legacy Ruby compiles) also. Fixed by passing --without-gcc:

RUBY_CONFIGURE_OPTS="--without-gcc --disable-install-rdoc" rbenv install 2.1.3
@mislav

This comment has been minimized.

Copy link
Member

mislav commented Sep 23, 2014

Ruby usually picks gcc-4.2 if it finds it in PATH but on Yosemite this Homebrew package seems broken. Maybe we should default CC=clang or --without-gcc on Yosemite for now for Rubies 2.0+? How does everybody feel about that workaround?

@keltia

This comment has been minimized.

Copy link

keltia commented Sep 23, 2014

I'm surprised that we need to do anything special with Yosemite as I'd expect to be just like any OS X version with respect to cc/clang/gcc. OTOH I do not have 10.10 installed yet. Workaround seems good enough for now.

@jeremy

This comment has been minimized.

Copy link
Member

jeremy commented Sep 23, 2014

@keltia pretty much every OS X version has changed the cc/clang/gcc situation 😁

👍 for --without-gcc on 10.10 as a stopgap measure, but I assume this may need attention with Ruby upstream…

@gregory

This comment has been minimized.

Copy link

gregory commented Oct 5, 2014

export CC=/usr/bin/gcc worked for me on 10.10

@mislav

This comment has been minimized.

Copy link
Member

mislav commented Oct 12, 2014

Tracking this issue in ruby-build now. Use CC=clang on Yosemite for all your Ruby building needs until a fix lands in ruby-build.

@mislav mislav closed this Oct 12, 2014

@GrandSlam

This comment has been minimized.

Copy link

GrandSlam commented Oct 18, 2014

CC=/usr/bin/gcc also worked for me on 10.10
alias=rbi="CC=/usr/bin/gcc rbenv install"

@aledalgrande

This comment has been minimized.

Copy link

aledalgrande commented Oct 19, 2014

The issue mentioned by @mislav is rbenv/ruby-build#651

@alexbeletsky

This comment has been minimized.

Copy link

alexbeletsky commented Dec 3, 2014

@jamonholmgren thanks a lot, CC=/usr/bin/gcc worked with rvm for ruby-1.9.2 on 10.10

@rizidoro

This comment has been minimized.

Copy link

rizidoro commented Dec 17, 2014

CC=/usr/bin/gcc worked for me too...

@jchan172

This comment has been minimized.

Copy link

jchan172 commented Feb 3, 2015

Thanks,
export CC=/usr/bin/gcc
rvm install ruby-2.0.0-p247
worked for me on OSX 10.10.

@arthurbryant

This comment has been minimized.

Copy link

arthurbryant commented Mar 4, 2015

Thank you!

export CC=/usr/bin/gcc
rbenv install 2.0.0p481

worked for me on OSX 10.10.2

@marcellosachs

This comment has been minimized.

Copy link

marcellosachs commented Jul 21, 2015

worked for me, thanks!

@serjant

This comment has been minimized.

Copy link

serjant commented Jul 21, 2015

export CC=/usr/bin/gcc

Works for me. Tnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment