1
votes

I have installed Ruby, latest version. I have installed XCode, latest version. I have installed CommandLine tools for XCode too.

Then I want to install Ruby on Rails, but I got the following error:

Fetching: json-1.7.5.gem (100%) Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension.

    /Users/JonyIve/.rvm/rubies/ruby-1.9.3-p327/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/JonyIve/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/json-1.7.5 for inspection. Results logged to /Users/JonyIve/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/json/ext/generator/gem_make.out

1
Please paste the contents of /Users/JonyIve/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/json/ext/generator/gem_make.out so we may get a better idea as to what went wrong here.hd1
Please show the actual command you use. Presumaby rvm ?Michael Durrant

1 Answers

3
votes

I think I had this problem when I was setting up rails env on newly installed 10.8 mac. Command Line tool was installed, but gcc is still missing. I refereed to some blog posts: (i.e. Beryllium Work) that recommended to create link to the location that the make script is looking for:

bash> sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
bash> sudo ln -s /usr/bin/g++ /usr/bin/g++-4.2

I think this solved my problem on installing rails