24

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.

System info:

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

Xcode v4.2.1

1 Answer 1

104

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
1
  • 1
    Better to use a relative path: sudo ln -s llvm-gcc-4.2 /usr/bin/gcc-4.2
    – tmandry
    Apr 15, 2013 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.