Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't gem install json -v '1.7.3'

I get the following output when trying to install json gem on lion:

gem install json -v '1.7.3' Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension.

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

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

like image 940
Victor S Avatar asked Jun 21 '12 03:06

Victor S


1 Answers

Use which gcc and create a symlink to it in /usr/bin/gcc-4.2. e.g.

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
like image 127
Bob Avatar answered Nov 08 '22 03:11

Bob