Gem update fails, no Xcode

心不动则不痛 提交于 2019-12-11 12:30:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!