Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to install ruby 2.1.2 with rbenv on OSX BUILD FAILED

Tags:

macos

ruby

rbenv

So, as the title suggests, I'm trying to install ruby 2.1.2, altough I've tried to install other versions as well, and I'm getting the same errors. I'm running OSX 10.9.2.

I've tried:

Installing a fresh gcc compiler, via brew install gcc47

Installing updated OSX command line tools

Uninstalling rbenv and trying again

Restarting the machine

Here is the sum of what I'm getting:

rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb4 25589e6635
Installing ruby-2.1.2...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728
Results logged to /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728.log

Last 10 log lines:
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
compiling miniinit.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
dtrace: failed to compile script probes.d: Preprocessor not found
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....
compiling compar.c

Thoughts?

Gist of verbose output

like image 766
wvm2008 Avatar asked May 28 '14 18:05

wvm2008


People also ask

How do I change Ruby from Rbenv to Mac?

rbenv global Sets the global version of Ruby to be used in all shells by writing the version name to the ~/.rbenv/version file. This version can be overridden by an application-specific .ruby-version file, or by setting the RBENV_VERSION environment variable.

Does Rbenv install Ruby?

Rbenv is a command line tool that lets you switch between installed versions of Ruby. It can also install new versions of Ruby using the ruby-build plugin.

What is Rbenv Ruby-build?

ruby-build is a command-line tool that simplifies installation of any Ruby version from source on Unix-like systems. It is available as a plugin for rbenv as the rbenv install command, or as a standalone program as the ruby-build command.


1 Answers

I was able to build it using:

CONFIGURE_OPTS="--disable-dtrace" rbenv install 2.1.2

Basically that's what is suggested in the question's comment by wicz.

The solution by KurtPreston did not work for me. Also using OS X 10.9.

like image 163
StephenKing Avatar answered Nov 13 '22 23:11

StephenKing