Can't upgrade Rails - Failed to build gem native extension

I am new to Rails and attempting to upgrade Rails on my Mac to latest
version so that I can follow the rails tutorial, but I just can’t seem
to get anywhere.

When I attempt to update rails with: $ sudo gem update rails -y, I
receive the following error.

ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

Any ideas what I am doing wrong, or what I can do to upgrade to rails?

Ruby Version is:1.8.7, patchlevel 174
Rails current version is: 2.3.5

Many thanks in advance…

====

Here is the full output when running…

iMac:blog jason$ sudo gem update rails -y

Updating installed gems
Updating rails
Fetching: activesupport-3.1.0.gem (100%)
Fetching: builder-3.0.0.gem (100%)
Fetching: i18n-0.6.0.gem (100%)
Fetching: bcrypt-ruby-3.0.0.gem (100%)
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/bcrypt-
ruby-3.0.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/bcrypt-ruby-3.0.0/ext/
mri/gem_make.out
Gems updated: multi_json, activesupport, builder, i18n
Installing ri documentation for multi_json-1.0.3…
Installing ri documentation for activesupport-3.1.0…
Installing ri documentation for builder-3.0.0…
Installing ri documentation for i18n-0.6.0…
Installing RDoc documentation for multi_json-1.0.3…
Installing RDoc documentation for activesupport-3.1.0…
Installing RDoc documentation for builder-3.0.0…
Installing RDoc documentation for i18n-0.6.0…

Quoting jay@oz [email protected]:

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

This is the key. Look for ruby.h somewhere else on your system or
install a
package named ruby-dev or ruby-devel. I don’t know Macs, so the exact
name
may vary. The Ruby package includes just the ruby libraries and
executables.
Ruby-dev includes header files and other files needed to compile and
build
Ruby and Ruby native extensions.

HTH,
Jeffrey

Thanks Jeffrey, I tried google both ruby-dev and ruby-devel, but
couldn’t find anything…

I do have a file osx_ruby.h… is this what you mean? What should I
do with it?

Is it seriously this hard to upgrade rails? I’ve been a CF developer
for years, and have been keen to give rails a try, but to be honest,
this is all starting to remind me of the bad old days of .jsp…

Thanks again Jeffrey…