The specific process varies between operating systems, but it generally revolves around setting up Ruby, RubyGems and installing Rails with the command:
$ sudo gem install rails
You can use one of these installation guides to help get you started:
Some users may prefer to skip manual installation by using a pre-integrated Ruby on Rails software appliance or an all-in-one native installer.
Discussion