install Rails from terminal

I have been having trouble install Rails from the terminal on my new
MacBook. I have tried to find a solution on both google and youtube, but
I have not find a solution to the problem

$ rails -v
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.

$ 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.6.6 for inspection.
Results logged to
/Library/Ruby/Gems/1.8/gems/json-1.6.6/ext/json/ext/generator/gem_make.out

hi,make sure that uve install ruby-dev package.

"hi,make sure that uve install ruby-dev package"

I have ruby installed on my computer already, gem as well just not
rails. That is where I am having my problems at.

I might been having an issue with gems and where it is installed. I just
tried install MYSQL and i got the same error message.

$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql --
--with-mysql-config=/usr/local/mysql/bin/mysql_config
Fetching: mysql-2.8.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing mysql:
  ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
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/mysql-2.8.1 for inspection.
Results logged to
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

Read the suggestion more carefully, it says you need the package
ruby-dev installed.

Colin

yes,its ruby-dev!!!make sure!!! ;O

Hello first of all remove ruby folder that u have install in ur system
and follow the instruction from this link:
http://anuragsachan07.blogspot.in/2012/04/how-to-install-ruby-193-through-rvm-in.html
I have written this blog for ubuntu so that please make sure the
command for ur mac system.
after installing ruby in ur system follow the instruction for
installing rails in ur system:
http://railsapps.github.com/installing-rails.html

Is the issue fixed?