2013-08-16 88 views
2

我对Rails的世界相当陌生,想创建另一个项目来玩一些代码。在运行'rails new myproject'时,我遇到了这个错误。我搜索了Google的解决方案,但没有运气。如何在运行“捆绑安装”时通过此问题继续创建我的Rails应用程序?错误:无法构建gem本机扩展。 JSON宝石

我运行:
OSX 10.7.5
的Rails 3.1.1
的Ruby 1.8.7(2012-02-08 PATCHLEVEL 358)万向darwin11.0]

Using coffee-script (2.2.0) Using rack-ssl (1.3.3) Installing json (1.8.0) with native extensions Gem::Installer::ExtensionBuildError: 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 /Users/me/.bundler/tmp/1673/gems/json-1.8.0 for inspection. Results logged to /Users/me/.bundler/tmp/1673/gems/json-1.8.0/ext/json/ext/generator/gem_make.out An error occured while installing json (1.8.0), and Bundler cannot continue. Make sure that gem install json -v '1.8.0' succeeds before bundling.

我注意到这条线,但不知道这意味着什么.. 错误:在/ Developer中找不到开发人员目录。运行/ usr/bin/xcode-select更新开发者目录路径。

谢谢!

+0

你运行的Xcode选? –

+0

我不这么认为。我该怎么做,在哪里? –

+0

从您的错误消息:'错误:在/ Developer中找不到开发人员目录。运行/ usr/bin/xcode-select来更新开发者目录路径。“ - 你需要从任何地方访问:'/ usr/bin/xcode-select' –

回答

0

您可能需要从偏好在Xcode 4安装“命令行工具”

+0

命令行工具未安装。我正在下载。希望这能解决这个问题!一旦完成,我会更新。 –

+0

希望它解决了这个问题! –

+0

这没有奏效。我已经更新了我原来的帖子,并提供了我现在收到的错误消息,因为它在某些方面有所不同。 –

相关问题