Os X Mountain Lion: Gcc-4.2 No Such File or Directory

OS X Mountain Lion: gcc-4.2 No such file or directory

If you have Xcode installed, gcc should be available. Check where it is with:

kamil$ which gcc
/usr/bin/gcc

Then make a user-land symbolic link from gcc-4.2 to plain gcc:

kamil$ sudo ln -s ~/bin/gcc /usr/bin/gcc-4.2

(Ensure the user-land bind folder is in your path via export PATH=...:$HOME/bin in your .bash_profile or .zshrc.)

Gem installed fine afterwards.

GCC-4.2 error on Mac OS-X Mountain Lion, unable to install some packages with pip / virtualenv

Same problem with pycrypto install failing to compile in a virtualenv. Found the solution in this thread by poster jiaaro:
https://gist.github.com/3179227#gistcomment-379913

You need to install Xcode 4.4 (from the app store) and then, within
xcode open Xcode > Preferences (or press Cmd + ,)
then open the downloads tab and install the Command Line Tools.

On Mac OSx Mountain Lion 10.8 I had xCode 4.3 installed WITH the command line tools. I did the update to xCode 4.4 and it still didn't work. Xcode does not automatically download the new command line tools apparently even if you had them installed. As the post from jiaaro states, you have to explicitly download the command line tools again.

Current version of gcc is below and does successfully sudo pip install packages in virtualenv for me with no need to sym link.

gcc

i686-apple-darwin11-llvm-gcc-4.2

GCC-4.2 error on Mac OSX Mountain Lion, unable to install mysql-python

I've had a similar problem while working with Ruby On Rails 3.2.7.
I too had upgraded the system to Mountain Lion, installed Xcode 4.4.1 and downloaded the Command Line Tools.

On the command line I got an error message saying it was impossible to find the file: /usr/bin/gcc-4.2 (I can't paste the precise output right now, I'm sorry).

I did have a /usr/bin/gcc and its version was i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1

I solved the problem by symlinking the file in the same directory and giving it the name the Ruby script was looking for:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

After that, everything worked fine.

/usr/bin/gcc-4.2: No such file or directory. error. symlink fix doesn't work

/usr/bin/gcc-4.2 could already be a symlink, but a broken one that points to a nonexistent file.

Installing ruby 1.9.3 on Mac OSX 10.8.2

Try this to let rvm know which gcc to use:

CC=/usr/bin/gcc-4.2 rvm install 1.9.3 

Or, if you want to use the Homebrew-installed gcc:

CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3

It depends on where the gcc-4.2 interpreter is.

Two alternatives:

rvm install 1.9.3 --with-gcc=clang

Or use ruby-build.

EDIT September 7, 2013: Another alternative that I'm liking quite a lot for installing Rubies is ruby-install. It's in the spirit of the same author's chruby. Simple and gets the job done well.

OS X 10.8 - error trying to exec '/usr/bin/i686-apple-darwin11-gcc-4.2.1' - installing json gem

I'm under the impression that all you need to do is:

sudo ln -sf /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2

I tried with xcode-select XCode and the commandline tools. They both work.
I also uninstalled the brew apple-gcc42 and it still works.
export CC isn't needed either.

So basically just the link. Hope this solves some issues people are having.



Related Topics



Leave a reply



Submit