Oct 282011

Remove RVM, thus making for a cleaner install later:

$ RVM implode

Remove XCode:

$ sudo /Developer/Library/uninstall-devtools –mode=all

XCode is removed since in 4.2, at least, all references to gcc are linked to llvm-gcc (Apple’s) own fork of gcc. llvm will NOT compile ruby.

(One can always re-install from the AppStore later)
download and install GCC-10.7-v2.pkg from https://github.com/kennethreitz/osx-gcc-installer/downloads

This will install just the bare-bones GCC compiler. It can safely be overwritten by XCode if you decide to reinstall it, or simple removed using the same command as that used for removing XCode.
reinstall RVM: http://beginrescueend.com/rvm/install/
Install the package manager “homebrew” from http://mxcl.github.com/homebrew/ and with it install libiconv.

$ brew install libiconv

This will install several files to homebrew’s home directory “/usr/local/cellar
backup /usr/local/lib/libiconv.2.dylib, and copy /usr/local/cellar/libiconv/1.14/lib/libiconv.2.dylib into it’s place in /usr/local/lib

At this point you should have everything in place to install ruby 1.9.2 using RVM:

CC=gcc-4.2 rvm install 1.9.2-p290 --with-iconv-dir=/usr/local/Cellar/libiconv/1.14.1

(RVM does not actually support –with-iconv-dir, if you check the config.log file, but it might someday… in which case the copying of libiconv will be unnecessary)

Now go install gems and rails and anything else you might need.


{my stack overflow comment}

Oct 272011

Im my experience (limited), changing CC in .profile does not change Lion’s (10.7.2) defaulting to i686-apple-darwin11-llvm-gcc-4.2. I wonder if this has anything to do with Apple’s own sym linking:
a partial: $ls -la /usr/bin | grep .*gcc.*:

lrwxr-xr-x     1 root   wheel        12 25 oct 19:31 cc -> llvm-gcc-4.2lrwxr-xr-x     1 root   wheel        12 25 oct 19:31 gcc -> llvm-gcc-4.2lrwxr-xr-x     1 root   admin        32 25 oct 19:31 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2

I am wary about breaking these and adding my own to usr/bin/gcc-4.2 per Martin v. Löwis’s answer.

my stackoverflow response…. no one noticed I was running Lion in this response… odd b/c Leopard ships will GCC.