问题
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?
回答1:
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?
回答2:
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.
回答3:
I appears to be looking for (part of) the source for Ruby. You might try getting that and installing it too.
来源:https://stackoverflow.com/questions/1395596/gem-update-fails-no-xcode