63

rebuilding a mac from scratch. Installed xcode and rvm then trying to install rubies but they are all giving me:

Error running ' ./configure --prefix=/Users/durrantm/.rvm/rubies/ruby-1.9.3-p125 
--enable-shared --disable-install-doc --with-libyaml 
--with-opt-dir=/Users/durrantm/.rvm/usr ', 
please read /Users/durrantm/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.
Michaels-MacBook-Air:~ durrantm$ 

The log has:

checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/durrantm/.rvm/src/ruby-1.9.2-p290':
configure: error: no acceptable C compiler found in $PATH

Do I need the gcc C compliler? How do I install it ?

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

4 Answers4

176

The critical step is actually installing the Xcode command line tools after the download completes and Xcode is installed

After downloading and installing Xcode from the app store, you need to actually install the command line tools it provides.
To do this open Xcode, go to preferences then downloads. There is an "Install" link to add the command line tools.

Once this has been completed, make sure to re-open your terminal window.

Community
  • 1
  • 1
Craig Ulliott
  • 1,936
  • 1
  • 11
  • 5
  • 9
    +1 for adding info about installing the Xcode Command Line Tools – tatlar Jul 26 '12 at 16:56
  • Brilliant comment, saved me tons of time. – Oldek Aug 12 '12 at 13:13
  • How could I know without seeing this answer??? Thanks for pointing this out! BTW mine works without reopening my terminal window. – Hlung Sep 18 '12 at 07:05
  • I have been strugling two days before I find this answer. +1 for pointing out the Xcode CL tools. I am now able to install and use Xdebug – P.M Oct 21 '12 at 17:05
10

Either you install Xcode from the App store or if you have a registered free developer account you can download the XCode command line tools from http://developer.apple.com/downloads

Once you have that installed you can go ahead and install your rubies with rvm.

three
  • 8,262
  • 3
  • 35
  • 39
2

rbenv install error :

configure: error: in `/tmp/ruby-build.20130911002344.31969/ruby-2.0.0-p0':
configure: error: no acceptable C compiler found in $PATH

...brought me here,

I am currently installing Ruby on rails, ruby through rbenv on a brand new Debian,

Original command is :

rbenv install 2.0.0-p0  

As a solution :

sudo apt-get install build-essential

Cheers !

[Sorry for the Xcode ppl]

Steve Lng C
  • 1,204
  • 1
  • 8
  • 9
0

Read rvm requirements it shows what you need to compile ruby.

mpapis
  • 52,729
  • 14
  • 121
  • 158