9zeqca
Last Updated: February 25, 2016
·
742
· sotsy
E230206807555e69636d2a0c0ff7048d

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