Why can't I install Rails on Lion using RVM?
Solution 1:
Fixed it!
The answer was actually on one of the links I posted above. Before installing a version of ruby (rvm install 1.8.7) I needed to run "export CC=/usr/bin/gcc-4.2
". With that in place, everything ran smoothly.
If you don't want to have CC
permanently exported, you can do CC=/usr/bin/gcc-4.2 rvm install 1.8.7
If you have already installed ruby 1.8.7. Just do CC=/usr/bin/gcc-4.2 rvm reinstall 1.8.7
Solution 2:
If you have installed Xcode 4.2, it actually doesn't install non-LLVM gcc anymore, so you have to add it. For some reason downgrading to 4.1 after you've installed 4.2 doesn't work correctly (at least it didn't for me and others have had similar issues).
After quite a bit of thrashing, this is what finally worked for me:
- Install Xcode 4.2 from App Store
- Install darwin gcc using the OSX gcc installer
- Install REE making sure you remove any vestiges of previous attempts:
Close any open terminal windows, open a fresh one and
rvm remove ree
export CC=/usr/bin/gcc-4.2
rvm install ree
This worked for me with rvm 1.8.6, OS X 10.7.2 and gcc-4.2 version 4.2.1 (Apple build 5666).
If you have already installed Xcode 4.1, resist the urge to upgrade to 4.2 and you should be okay.
Solution 3:
If that still doesn't work add --force. So this becomes:
CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force