本文介绍了未能建立与原生扩展JSON(1.6.3)我装X code 4.2之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您熟悉这个错误?我不知道如何解决这一问题:

Are you familiar with this error? I have no idea how to fix this:

Installing json (1.6.3) with native extensions  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/boris/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb  creating Makefile

make /usr/bin/gcc-4.2 -I.
-I/Users/boris/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin10.8.0
-I/Users/boris/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward
-I/Users/boris/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe -O3 -Wall  -o parser.o -c parser.c make: /usr/bin/gcc-4.2: No such file or directory make: *** [parser.o] Error 1


Gem files will remain installed in /Users/boris/.rvm/gems/ruby-1.9.2-p290@apps2/gems/json-1.6.3 for inspection. Results logged to /Users/boris/.rvm/gems/ruby-1.9.2-p290@apps2/gems/json-1.6.3/ext/json/ext/parser/gem_make.out An error occured while installing json (1.6.3), and Bundler cannot continue. Make sure that `gem install json -v '1.6.3'` succeeds before bundling.

系统信息:

gem -v
1.8.10
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

X $ C $çV4.2.1

Xcode v4.2.1

推荐答案

生成文件引用 /usr/bin/gcc-4.2 ...我解决了这个通过创建符号链接正确的可执行文件:

The makefile references /usr/bin/gcc-4.2 … I solved this by creating a symlink to the correct executable:

sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2

这篇关于未能建立与原生扩展JSON(1.6.3)我装X code 4.2之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 06:18