title: Rails installation error - Failed to build gem native extension
body: <p>I seem to have a conflict when trying to install Rails on Mountain Lion. I have tried updating Ruby but this did not help. I also tried Rails Installer but that also gave an error. Ruby version is 1.8.7</p>
  
  <p>Here is the error I am getting from terminal </p>
  
  <pre><code>sudo gem install rails
  Building native extensions.  This could take a while...
  ERROR:  Error installing rails:
  ERROR: Failed to build gem native extension.
  
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
  mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
  
  
  Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/atomic-1.1.10 for inspection.
  Results logged to /Library/Ruby/Gems/1.8/gems/atomic-1.1.10/ext/gem_make.out
  </code></pre>