2

I just update my OS to mavericks in my Mac. before updating my OS, i didn't have a problem to create a new project in rails, but now, when i try to create a new project get an error. this is what I do:

tomers-MacBook-Pro:bootstrapProject tomerdoar$ rails new blog

and i get this error:

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

    /Users/tomerdoar/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
creating Makefile

make
compiling generator.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [generator.o] Error 1


Gem files will remain installed in /Users/tomerdoar/.rvm/gems/ruby-1.9.3-p194/gems/json-1.8.1       for inspection.
Results logged to /Users/tomerdoar/.rvm/gems/ruby-1.9.3-p194/gems/json- 1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

then, as its said, i am trying to install json -v '1.8.1'. I do this:

tomers-MacBook-Pro:bootstrapProject tomerdoar$ gem install json -v '1.8.1'

and I get this error:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

    /Users/tomerdoar/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
creating Makefile

make
compiling generator.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [generator.o] Error 1


Gem files will remain installed in /Users/tomerdoar/.rvm/gems/ruby-1.9.3-p194/gems/json-1.8.1     for inspection.
Results logged to /Users/tomerdoar/.rvm/gems/ruby-1.9.3-p194/gems/json-    1.8.1/ext/json/ext/generator/gem_make.out

and from that point, I really don't know what to do. I tried to look for similar errors and solution on the web and non of them help, I still get this error.

Is there any way to fix it, and if there is can you tell me step by step what to do?

1 Answers1

1

I found the answer by myself, i had to do those steps:

tomers-MacBook-Pro:bootstrapProject tomerdoar$brew tap homebrew/versions && brew install apple-gcc42

tomers-MacBook-Pro:bootstrapProject tomerdoar$brew link --force apple-gcc42

tomers-MacBook-Pro:bootstrapProject tomerdoar$ln -nsf $(which gcc-4.2) /usr/bin/gcc-4.2

and i don't have any problem right now