Hi,

By default, ruby 1.8.7 came with my mac. But I could not update rubygems, I just got this error:

Updating installed gems
Updating RedCloth
WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
	  /usr/bin aren't both writable.
WARNING:  You don't have /Users/agherschon/.gem/ruby/1.8/bin in your PATH,
	  gem executables will not run.
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.
 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb update
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 /Users/agherschon/.gem/ruby/1.8/gems/RedCloth-4.2.2 for inspection.
Results logged to /Users/agherschon/.gem/ruby/1.8/gems/RedCloth-4.2.2/ext/redcloth_scan/gem_make.out

To resolve that, you have to install XCode. Right after this step, things are easier :

  • sudo gem update
  • sudo gem install rails –include-dependencies

That’s it !