0

Possible Duplicate:
OS X Mountain Lion: gcc-4.2 No such file or directory

I'm facing a problem to install rails on my MAC.

I'm learning RoR by myself but I can't install rails.

This is what I did: 1 - Installed XCode and downloaded 'Command Line Tools'

2 - Installed RVM with this code:

curl -L https://get.rvm.io | bash -s stable

3 - Installed HomeBrew and libksba:

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

brew install libksba

4 - Installed Ruby with RVM (RVM command only worked after I restarted the system):

rvm install 1.9.3

5 - Defined Ruby 1.9.3 as default:

rvm --default 1.9.3

6 - Now I'm trying to run this code:

gem install rails

But it returns this error:

Guerreiro:~ rguerreiro$ gem install rails Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension.

   /Users/rguerreiro/.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/rguerreiro/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5 for inspection. Results logged to /Users/rguerreiro/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5/ext/json/ext/generator/gem_make.out

Community
  • 1
  • 1
Rafael Guerreiro
  • 196
  • 3
  • 14
  • 1
    Check out the answer to [this question](http://stackoverflow.com/questions/12256616/os-x-mountain-lion-gcc-4-2-no-such-file-or-directory): verify your XCode and gcc setup. – rossta Oct 05 '12 at 12:21
  • YEAH!!! It worked!!! Really really thanks! Please, post it like an answer, so I can mark as solution! – Rafael Guerreiro Oct 05 '12 at 12:45

2 Answers2

0

RVM supports multiple rubies of different versions and hence is preferred for RoR development. checkout the installation steps at https://rvm.io/rvm/install/

pjumble
  • 16,880
  • 6
  • 43
  • 51
Prasad Surase
  • 6,486
  • 6
  • 39
  • 58
0

did you read rvm requirements? it will tell you how to get osx-gcc-installer - install it and it should move to next step.

mpapis
  • 52,729
  • 14
  • 121
  • 158