当我尝试 sudo gem install json 我收到以下错误 [英] When I try sudo gem install json I get the following error
本文介绍了当我尝试 sudo gem install json 我收到以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要安装 JSON gem 来启动我的应用程序,但每当我尝试安装 json gem 时都会收到以下错误.谁能帮我吗.我正在使用 rails 2.2.2 和 gems 1.3.1.
I need to install the JSON gem to start my app but I get the error below whenever I try to install the json gem. Can anyone help me out. I'm using rails 2.2.2 and gems 1.3.1.
Arions-macbook-pro:.ssh arion$ sudo gem install json
Password:
Sorry, try again.
Password:
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 install json
can't find header files for ruby.
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.1.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.1.4/ext/json/ext/parser/gem_make.out
推荐答案
使用 Mavericks,您可以通过从命令行安装 Xcode 命令行工具来解决此问题,如下所示:
With Mavericks, you can solve this problem by installing the Xcode Command Line Tools from the command line like this:
xcode-select --install
更新:安装或更新后不要忘记接受许可协议:
Update: Don't forget to accept the license agreement after you install or update:
sudo xcodebuild -license
这篇关于当我尝试 sudo gem install json 我收到以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文