我尝试运行捆绑安装,它停在json gem上.所以我试着运行sudo gem安装json 1.7.3它是它崩溃的版本它给出以下内容:
unknown109addaae0a6:introhive Jody$sudo gem install json Building native extensions. This could take a while... ERROR: Error installing json: 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/json-1.7.3 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
那么如果我看看gem_make.out文件,它看起来像这样:
/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
我已经尝试确保安装了命令行工具,但是我有一些损失,如何获得这个.
任何帮助将不胜感激.谢谢
解决方法
我正在安装JSON 1.7.4时遇到类似的问题,除非我使用RVM.无论如何,我做了解决我的问题是从
developer.apple.com安装Xcode 4.4,一旦安装了我必须安装Xcode的命令行工具.您可以通过启动Xcode然后单击Xcode>来安装命令行工具.首选项>下载并单击命令行工具旁边的安装.