Appendix B. Ruby on Rails Guide

This appendix contains a reference for the most commonly used features and attributes of Rails. It is not exhaustive, but is intended to be a good first place to look for many frequently performed tasks. This guide is based on Rails 2.0.2. For exhaustive and up-to-the minute information, check out the official Rails documentation.

Getting Started

In order to run Ruby on Rails, you need to install the following:

  • Ruby. Version 1.8.6 is the officially recommended version for Rails 2.0.2. A binary installer is available for Windows XP and Vista. Most Linux distributions either include Ruby or have a binary package available. Mac OS X 10.5 ships with a suitable version of Ruby installed, but the version in Mac OS X 10.4.x needs to be modified slightly. See the Ruby on Rails download page (www.rubyonrails.org/down) for more details.

  • The RubyGems package manager. This should be included with any binary distribution, but can also be downloaded from http://docs.rubygems.org.

  • Rails. This is most easily installed through RubyGems and the command gem install rails. (On some systems, you may be required to run this command as sudo.)

  • A database. Rails works with all of the most commonly available relational database systems. The Rails default for new programs as of version 2.0.2 is SQLite; however, MySQL is probably most common for typical deployments. You need to install the database, as well as a Ruby gem that allows Ruby programs to interact with the database. As ...

Get Ruby on Rails® Bible now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.