Topic: Error installing rails after installed ruby gems, how to solve it?

Chanteki-MacBook-Pro:~ chanwaihung$ sudo gem install -y rails
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Building native extensions.  This could take a while...
ERROR:  Error installing rails:

ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
Chanteki-MacBook-Pro:~ chanwaihung$ rails
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.
Chanteki-MacBook-Pro:~ chanwaihung$ sudo gem install rails
Building native extensions.  This could take a while...
ERROR:  Error installing rails:

ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
Chanteki-MacBook-Pro:~ chanwaihung$ rails
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.
Chanteki-MacBook-Pro:~ chanwaihung$

Last edited by iqer2000 (2012-07-08 02:21:11)

Re: Error installing rails after installed ruby gems, how to solve it?

I'd suggest starting over with a newer version of Ruby. Maybe 1.9.2. I'd then install rvm. Then install rails into that. At this point I don't see a reason to be working with something that old. It's going to be harder to get help, and some problems will already be solved.

I'm a Phoenix Ruby on Rails developer currently available for freelance work.

Re: Error installing rails after installed ruby gems, how to solve it?

Thank you for your kind attention.

What are the procedures to do so?

Re: Error installing rails after installed ruby gems, how to solve it?

The  rvm (ruby version manager) site has a ton of information and step by step guides. You should start there.

I'm a Phoenix Ruby on Rails developer currently available for freelance work.