ruby-install: Ruby 2.1.3 - getting `configure: error: something wrong with CFLAGS="-g -O2 "`

Ruby 2.1.2 installed fine a while back. Now 2.1.3 is failing.

➜  ~  ruby-install ruby 2.1.3
>>> Installing ruby 2.1.3 into /Users/jh/.rubies/ruby-2.1.3 ...
>>> Installing dependencies for ruby 2.1.3 ...
Warning: openssl-1.0.1i already installed
Warning: readline-6.3.8 already installed
Warning: libyaml-0.1.6 already installed
Warning: gdbm-1.11 already installed
Warning: libffi-3.0.13 already installed
>>> Downloading http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.3.tar.bz2 into /Users/jh/src ...
*** No checksum for ruby-2.1.3.tar.bz2. Proceeding anyways
>>> Extracting ruby-2.1.3.tar.bz2 to /Users/jh/src/ruby-2.1.3 ...
>>> Configuring ruby 2.1.3 ...
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
checking for gcc-4.2... gcc-4.2
couldn't understand kern.osversion `14.0.0'
checking for gcc... (cached) gcc-4.2
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 for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ 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/bin/install -c
checking for a thread-safe mkdir -p...  -d
use 'mkdir -p' as MKDIR_P
checking for dtrace... dtrace
checking for dot... dot
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="-g -O2 "
!!! Configuration of ruby 2.1.3 failed!
➜  ~

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

Workaround posted on referenced rbenv issue does work.

CC=/usr/bin/gcc ruby-install ruby 2.1.3

CC=/usr/bin/gcc rvm install ruby-2.3.0

also worked to compile 2.3.0 in MAC OS X Sierra.