Ruby on Rails:无法安装JSON宝石 [英] Ruby on Rails: Can't install JSON gem

查看:170
本文介绍了Ruby on Rails:无法安装JSON宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试创建一个新的Rails应用程序 rails新应用程序时,尝试安装JSON gem时进程停止。所以,我试图单独安装它,使用:

When I try to create a new Rails application rails new app, the process stops when trying to install the JSON gem. So, I tried to install it alone, using:

gem install json

但我收到以下错误讯息:

but I get the following error message:

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
creating Makefile

make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -DJSON_GENERATOR  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -O3 -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -c generator.c
Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path.
make: *** [generator.o] Error 1

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.6/ext/json/ext/generator/gem_make.out

你知道这是什么意思吗?我该如何解决它?

Do you have any idea what does this mean? and how can I fix it?

一些额外的信息:我使用的是MacOSX,Rails版本是3.2.11。和Ruby版本是1.8.7。

Some additional information: I'm using MacOSX, the Rails version is 3.2.11. and the Ruby version is 1.8.7.

感谢您的帮助。

Thanks for your help.

推荐答案

不支持Ruby 1.8.X在Rails中下降了吗?我建议升级到1.9.3。对于你的宝石:如果本地扩展存在问题,请尝试使用`json-puregem代替,因为它完全用ruby编写,不需要本地扩展。

Isn't support for Ruby 1.8.X dropped in Rails? I recommend upgrading to 1.9.3. For your gem: if there are problems with the native extensions, try using the "`json-pure" gem instead, since it's written entirely in ruby and doesn't need the native extensions.

http://rubygems.org/gems/json_pure

这篇关于Ruby on Rails:无法安装JSON宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆