rubyist
rubyist

Reputation: 3132

Error installing rails 4 in mac

I am trying to set up rails in my mac(Yosemite) machine. But when I do

gem install rails

I get the following error. Please help.

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

    /Users/Paa/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb
creating Makefile

make  clean

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

make failed, exit code 2

Gem files will remain installed in /Users/Paa/.rvm/gems/ruby-1.9.3-p547/gems/json-1.8.2 for inspection.
Results logged to /Users/Paa/.rvm/gems/ruby-1.9.3-p547/extensions/x86_64-darwin-13/1.9.1/json-1.8.2/gem_make.out

What am I missing here.??

Upvotes: 0

Views: 178

Answers (1)

Hannah
Hannah

Reputation: 136

I think rvm might be trying to use gcc 4.6, which doesn't work properly with rvm. I believe you can:

  1. Uninstall gcc 4.6 (brew rm gcc46)
  2. Pull the latest rvm (rvm get stable)
  3. Retry gem install rails

Upvotes: 1

Related Questions