1

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?

August Lilleaas
  • 54,010
  • 13
  • 102
  • 111
kristian nissen
  • 2,809
  • 5
  • 44
  • 68

3 Answers3

2

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
  • 46,381
  • 14
  • 112
  • 137
  • I don't have that much space on my old G4. – kristian nissen Sep 08 '09 at 19:05
  • Maybe it's time to upgrade your harddisk, since you are going to need Xcode in order to compile native gems. – Ariejan Sep 09 '09 at 04:33
  • here is the error: sudo gem install rails 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 install rails can'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 Sep 29 '09 at 19:06
0

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.

Community
  • 1
  • 1
Shawn Craver
  • 1,986
  • 1
  • 15
  • 16
0

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

dlamblin
  • 43,965
  • 20
  • 101
  • 140