当我尝试创建一个新的 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。
谢谢你的帮助。