簡體   English   中英

Ruby on Rails:無法安裝JSON gem

[英]Ruby on Rails: Can't install JSON gem

當我嘗試創建新的Rails應用程序rails new app時,嘗試安裝JSON gem時該過程停止。 因此,我嘗試使用以下命令單獨安裝它:

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

你知道這是什么意思嗎? 以及如何解決?

一些其他信息:我正在使用MacOSX,Rails版本是3.2.11。 Ruby版本是1.8.7。

謝謝你的幫助。

Rails中不支持Ruby 1.8.X嗎? 我建議升級到1.9.3。 對於您的gem:如果本機擴展存在問題,請嘗試使用“`json-pure” gem,因為它完全是用ruby編寫的,不需要本機擴展。

http://rubygems.org/gems/json_pure

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM