The preferred method of installing Rails is through the packaging scheme RubyGems that makes it really easy to install libraries and keep them up to date. Here's how you install Rails using RubyGems:

# "Get hold of RubyGems 0.8.1 ":http://rubyforge.org/frs/?group_id=126 (or higher) 
# @gem install rails@ (accept all the dependencies)
# @rails /my/complete/path/to/railsapp@

That's it! When new versions of Active Record and Action Pack are released, you just do @gem update@, and you'll have the new versions available to your app.

_Note You may have to run @sudo ruby setup.rb@  before @gem install rails@ if you have compiled from source._

_Note: If you want to run EdgeRails using the bleeding versions from SVN, then you should pick the regular set of Rails as a file._
_Note: Debian users should check out _"Putting Debian on Ruby rails":http://mentalized.net/journal/2004/12/01/putting_debian_on_ruby_rails/index.asp

h2. Tying your app to a specific set of library versions

Go to config/environment.rb where you can tie Rails to specific versions like this (this will lock your app to 0.12.1 or newer:

<pre>
require_gem 'activesupport', '>= 1.0.4'
require_gem 'activerecord', '>= 1.10.1'
require_gem 'actionpack', '>= 1.8.1'
require_gem 'actionmailer', '>= 0.9.1'
require_gem 'actionwebservice', '>=0.7.1'
</pre>

<pre>
'= x.y.z' to keep it at a single version
'>= x.y.z' to use that version or newer
'<= x.y.z' to use that version or older
</pre>

h2. Running beta gems. 

Use at own risk:

<tt>gem update -s http://gems.rubyonrails.com</tt>
_Note: @-s@ didn't work for me, try this: @gem update --source http://gems.rubyonrails.com@ instead_

h2. Running @gem install@ when you are behind a proxy.

Set the HTTP_PROXY environment variable.

NB: This may not work if you are behind a Microsoft ISA Proxy server with only NTLM (MS ISA Server proprietary) authentication available. If this is the case, you can try the "Microsoft Firewall Client":http://www.microsoft.com/resources/documentation/isa/2000/enterprise/proddocs/en-us/isadocs/m_p_p_enablewinsockapp.mspx or the Python "NTLM Authorization Proxy Server":http://apserver.sourceforge.net/ .

h2. Manual installation _(if all else fails...)_.

If @gem install rails@ still refuses to connect for some reason, perhaps because you are "firewalled out" somehow, @rails@ can be installed by installing the following gems manually, *in this order* (assuming you already have Ruby successfully installed):

# "Activesupport":http://rubyforge.org/projects/activesupport/
# "Actionpack":http://rubyforge.org/projects/actionpack/
# "Actionmailer":http://rubyforge.org/projects/actionmailer/
# "Activerecord":http://rubyforge.org/projects/activerecord/
# "Actionwebservice":http://rubyforge.org/projects/aws/
# "Rake":http://rubyforge.org/projects/rake/
# "Rails":http://rubyforge.org/projects/rails/

Of course, you will then have to continue downloading and updating each of these gems manually if you wish to stay current.
