1

I typed 'gem install middleman' in my terminal and got the following error message:

Building native extensions.  This could take a while...
ERROR:  Error installing middleman:
    ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile

make
compiling hitimes.c
make: gcc-4.2: No such file or directory
make: *** [hitimes.o] Error 1


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2/ext/hitimes/c/gem_make.out
JTG
  • 8,587
  • 6
  • 31
  • 38
elenawalom
  • 31
  • 3
  • Found a similar question here: http://stackoverflow.com/questions/23429145/error-failed-to-build-gem-native-extension-ruby-extconf-rb-mac-osx – Andrei Oct 12 '14 at 19:02

1 Answers1

2

Looks like you're missing gcc-4.2

Do you have any GCC installed (if you're on a Mac, you need to install Xcode)?

which gcc

If you already have a version of gcc, you can simply symlink to it

ln -s /usr/bin/gcc /usr/bin/gcc-4.2
vinhboy
  • 8,542
  • 7
  • 34
  • 44