Last Updated: February 25, 2016
·
1.248K
· sotsy

Mac OS X 10.8 Error installing Ruby Gems

bundle or gem install fails in OSX 10.8 with the following error.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/sots/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb 

creating Makefile

make
compiling generator.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [generator.o] Error 1

Solution to solve problem

sudo xcode-select -switch /usr/bin
sudo ln -sf /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2