Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was trying to install the newest version of Ruby via RVM, after I upgraded my Mac to Lion and installed the new Xcode 4.1 from the App store. I get this error in the log:

[2011-07-20 16:57:15]  ./configure
--prefix=/Users/justin/.rvm/rubies/ruby-1.9.2-p290 --enable-shared
--disable-install-doc --with-libyaml-dir=/Users/justin/.rvm/usr

configure: WARNING: unrecognized options: --with-libyaml-dir 
checking build system type... i386-apple-darwin11.0.0 
checking host system type... i386-apple-darwin11.0.0 
checking target system type...i386-apple-darwin11.0.0
checking for gcc... no 
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/justin/.rvm/src/ruby-1.9.2-p290': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details

Can anyone tell me what's wrong?

This in the terminal:

ruby-1.9.2-p290 - #extracted to /Users/justin/.rvm/src/ruby-1.9.2-p290 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/justin/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/justin/.rvm/src
Configuring yaml in /Users/justin/.rvm/src/yaml-0.1.4.
ERROR: Error running ' ./configure --prefix="/Users/justin/.rvm/usr"  ', please read /Users/justin/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /Users/justin/.rvm/src/yaml-0.1.4.
ERROR: Error running '/usr/bin/make ', please read /Users/justin/.rvm/log/ruby-1.9.2-p290/yaml/make.log
Installing yaml to /Users/justin/.rvm/usr
ERROR: Error running '/usr/bin/make install', please read /Users/justin/.rvm/log/ruby-1.9.2-p290/yaml/make.install.log
ruby-1.9.2-p290 - #configuring 
ERROR: Error running ' ./configure --prefix=/Users/justin/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/justin/.rvm/usr ', please read /Users/justin/.rvm/log/ruby-1.9.2-p290/configure.log
ERROR: There has been an error while running configure. Halting the installation.
Migrating gems from ruby-1.9.2-p180 to ruby-1.9.2-p290
ERROR: Ruby 'ruby-1.9.2-p290' is not installed - please install it first.
ERROR: Error migrating gems.

My $PATH is:

  • /opt/local/bin
  • /opt/local/sbin
  • /Users/justin/.rvm/gems/ruby-1.9.2-p180/bin
  • /Users/justin/.rvm/gems/ruby-1.9.2-p180@global/bin
  • /Users/justin/.rvm/rubies/ruby-1.9.2-p180/bin
  • /Users/justin/.rvm/bin
  • /usr/bin
  • /bin
  • /usr/sbin
  • /sbin
  • /usr/local/bin
  • /usr/X11/bin
  • /usr/local/mysql/bin

And neither gcc nor cc are found.

 ~ $ type gcc
-bash: type: gcc: not found
 ~ $ 
 ~ $ type cc
-bash: type: cc: not found
 ~ $ 
share|improve this question
    
"no acceptable C compiler found in $PATH". That is quite clear. "See `config.log' for more details". What does it say in this file? –  slhck Jul 20 '11 at 21:10
1  
nothing ... so I guess it's not that clear, is it? –  Slick23 Jul 20 '11 at 21:11
    
Well the basic problem is that you don't seem to have a compiler in your $PATH. Show us the output of echo $PATH. What happens when you enter type gcc or type cc? Just edit the info into your question. –  slhck Jul 20 '11 at 21:13
    
You might want to reinstall Xcode, as it probably didn't really install everything properly (or failed to put everything into its right place). –  slhck Jul 20 '11 at 21:34
    
Problem is it won't let me download it now, because the app store says it's already installed. I'm trying to download 4, but the developer site is having some trouble. –  Slick23 Jul 20 '11 at 21:37
show 3 more comments

4 Answers

up vote 8 down vote accepted

I'll post the answer here for anyone else having the same trouble. The App Store seems to have killed my Xcode 3.2.2 install without actually installing 4.1 (maybe it would work better with a new version of Xcode installed, or no version at all). The App Store did download an Install Xcode.app file, which I used to complete the install -- it did this silently, without any notice.

Once Xcode was up and running correctly again, Ruby complied just fine.

share|improve this answer
1  
This saved my day (and confirmed my already strong suspicions that the App Store is getting in my way as a user rather than help me). Thanks! –  Paolo Perrotta Aug 1 '11 at 19:33
add comment

The new XCode, 4.3, appears to have a Downloads in its preferences that allows you to install the commandline tools.

share|improve this answer
add comment

Installing the command line tools in Xcode (ver. 4.5.2) (see Preferences -> Downloads) fixed the "no acceptable C compiler found in $PATH" problem for me.

share|improve this answer
add comment

After upgrading to OS X 10.7, but before updating to Xcode 4.1, I got the same "No acceptable C compiler" error message when trying to install ruby1.9.2-p290.

Trying to edit PATH did not help in solving this issue.

After the Xcode 4.1 update, though, everything is running fine, as usual:

cd ruby-1.9.x-pyyy
./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.