Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to follow this guide Compiling Ruby, RubyGems, and Rails on Snow Leopard and I am running into a configuration issue.

After downloading and extracting the source, I am running a command to set up some configuration.

This is the output that I am given:

my-macbook-pro:ruby-1.9.1-p243 lillq$ ./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
checking build system type... i386-apple-darwin10.0.0
checking host system type... i386-apple-darwin10.0.0
checking target system type... i386-apple-darwin10.0.0
checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in `/Users/lillq/src/ruby-1.9.1-p243':
configure: error: C compiler cannot create executables
See `config.log' for more details.

Note: The first time I ran this it could not find gcc. To fix this I added to my path /Xcode3.1.4/usr/bin and sbin.

Then I decide to check whether I could compile code. (Its a new computer, I havent compiled on it before and I recently installed Xcode)

my-macbook-pro:~ lillq$ gcc test.c
test.c:1:19: error: stdio.h: No such file or directory
test.c: In function ‘main’:
test.c:5: warning: incompatible implicit declaration of built-in function ‘printf’


I thought that Xcode is suppose to install the compilers correctly for me. Is there something I am missing/doing wrong?


share|improve this question
up vote 2 down vote accepted

During XCode install, there is an option to also install the tools at the standard unix locations (binaries in /usr/bin, include files in /usr/include etc.). Did you choose that option during the installation?

I guess the error is because the compiler searches those standard paths for the header files (and also the standard libraries) and is not able to find them.

share|improve this answer
Yes! This was an install path issue. I reinstalled it and now everything is up and running. -Thanks – lillq Sep 25 '09 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .