I (more or less) followed the instructions here http://solarianprogrammer.com/2011/09/20/compiling-gcc-4-6-1-on-mac-osx-lion/ to install a more recent version of gcc so that I can build ruby on a new machine.
So I now have gcc installed to ~/my_gcc, and the instructions say to access gcc in this location by running
export PATH=$HOME/my_gcc/bin:$PATH
I did this, but am still getting the old gcc when I check the version.
$ gcc -v
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
If I move the gcc in /usr/bin/gcc to gcc_old, I don't get any gcc recognized even though when I echo $PATH the ~/my_gcc/bin path does show up. Should I just copy ~/my_gcc/bin to /usr/bin?
export
in your~/.bashrc
? Have you opened a new terminal? (Doesecho $PATH
show that path?)which gcc
. Are the files you compiled maybe not executable?