Ruby on Rails can be installed in a multitude of different ways and configurations. This covers the easiest and fastest ways to install Rails on Windows, Mac OS X and Ubuntu, optionally including Mongrel web server and MySQL. For more platform-specific guides, try GettingStartedWithRails.
Important note for Mac OS X 10.5 “Leopard” users: In Leopard and Leopard Server, Ruby and Rails are pre-installed along with a bounty of other useful RubyGems.
sudo gem update --system
sudo gem install rails
sudo gem update rake
sudo gem update sqlite3-ruby
After installing Xcode and running these commands, you will be ready to rock and roll with Ruby on Rails! If you’re not using Leopard or want to use a custom installation, continue on for the installation instructions using MacPorts.
MacPorts Installation (For previous versions of Mac OS X, or if you’d prefer not to use the default installation of Ruby in Leopard)
sudo port install rubyEnter the following at the command line to install Ruby along with some bits and pieces to make later installations easier:
sudo apt-get install ruby irb ri rdoc ruby1.8-dev build-essential
Simply enter the following command into Terminal:
sudo port install rb-rubygems
Another one-line installation:
sudo apt-get install rubygems
After installing RubyGems, you will need to add /var/lib/gems/1.8/bin/ to your path for easy access to any RubyGems you install later.
On all systems with RubyGems installed, Rails can be installed with the following command:
sudo gem install rails
Ruby on Rails comes packaged with WEBrick, a web server suitable for development purposes. However, if you you would like to see increased speeds or are planning to deploy your application, Mongrel is a more suitable web server.
Mongrel can be installed with the following command:
sudo gem install mongrel
You can now enter the following commands to test your Rails installation:
rails newrailsapp
cd newrailsapp
script/server
Direct your browser to http://localhost:3000/ and you should hopefully see the Rails welcome screen.
If you would rather have Ruby on Rails installed without any cryptic error messages, configuration or other stress in general, you should consider using Locomotive (Mac OS X) , Instant Rails (Windows) or RubyStack (Windows, Linux or Mac OS X) to install Rails. These packages contain everything you’ll need to get running with Rails. They have a simple installation process and are therefore highly suitable for beginners. Their only drawback tends to be that they are less customisable than a traditional Rails installation.
RubyStack is a preconfigured, self-contained installer for Apache, MySQL, Rails and a number of extensions such as Mongrel and ImageMagick. It runs on Windows, OS X and most Linux versions.
RM-Install for Mac OS X and Linux provides an single installer with Ruby, Rails, RubyGems, MySQL, SQLite, Subversion, Mongrel (optionally with Apache and a mongrel_cluster configuration), as well as commonly used libraries and tools (like Capistrano and RMagick).
The Ruby One-Click Installer for Mac OS X provides a simple installation for Ruby, RubyGems, Mongrel and the SQLite database. You will still need to install Rails using the instructions on this page though. This package is only 13MB, so you may find it useful if you would rather not download the Apple Developer Tools (Xcode) at around 900MB.