Cannot compile ruby 1.9.3 Cannot compile ruby 1.9.3 ruby ruby

Cannot compile ruby 1.9.3


With Xcode 4.6 I was also getting this problem. I installed the command line tools which made gcc available in /usr/bin/gcc.

I managed to get it to work using:

rvm install 1.9.3 --with-gcc=gcc

NB. I dont have homebrew installed.


you are using clang, according to this ticket http://bugs.ruby-lang.org/issues/5883 - it's not "fully" supported - you need to try using gcc-4.2, you get instructions for homebrew with running rvm requirements.

here is RVM ticket for this problem https://github.com/wayneeseguin/rvm/issues/1480

UPDATE: Ruby-2.0.0 actually compiles better with clang then with gcc-4.2, more details here: https://stackoverflow.com/a/15655034/497756


If you don't have rvm already installed, rvm requirements won't work. Install gcc 4.2 with homebrew and restart the rvm installation. Worked for me.

brew updatebrew tap homebrew/dupesbrew install apple-gcc42