views:

227

answers:

3

I ran sudo gem update earlier today and was thrilled to see it work, but at the end it failed.

Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb update
can't find header files for ruby.

I don't have Xcode, and if possible, I don't want to install it. Any other way to fix this?

+2  A: 

You will need to install xcode to get the c libraries that are required to build the c native extensions for some ruby gems. Is there any reason you dont want to install Xcode?

ennuikiller
I don't have that much space on my old G4.
kristian nissen
Maybe it's time to upgrade your harddisk, since you are going to need Xcode in order to compile native gems.
Ariejan
I installed xcode but I still get the same error
kristian nissen
which gem is it?
ennuikiller
here is the error:sudo gem install railsBuilding native extensions. This could take a while...ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension.ruby extconf.rb install railscan't find header files for ruby.Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7 for inspection.Results logged to /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/ext/fcgi/gem_make.out
kristian nissen
A: 

You might want to check out the answers to this question and this thread on the MacRumors forums. It looks like it's possible to install gcc & the right libraries without all of Xcode now, but you'll still need to download the whole DMG from Apple.

Shawn Craver
A: 

I appears to be looking for (part of) the source for Ruby. You might try getting that and installing it too.

dlamblin