Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - configure: error: no acceptable C compiler found in $PATH

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 ?

like image 994
Michael Durrant Avatar asked Feb 17 '12 05:02

Michael Durrant


People also ask

How do I fix configure error no acceptable C compiler found in $PATH?

If you ever get an error 'no acceptable C compiler found' while compiling OpenCA or any package, then the issue can be fixed by installing a C compiler (GCC or any appropriate compiler) and setting the path of the compiler in environment variable. Hope it helps.

How do I know if GCC is installed on Linux?

In the Command Prompt window type “gcc” and hit enter. If the output says something like “gcc: fatal error: no input files”, that is good, and you pass the test.


1 Answers

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.

like image 159
Craig Ulliott Avatar answered Sep 23 '22 13:09

Craig Ulliott