1. Computing

Ruby on Rails Tutorial - Starting the Blog

By

3 of 8

Generating a Rails Project

To generate a new Rails project, simply run the rails command from the command-line with the name of your project as an argument. Ruby on Rails will then create a basic application and supporting scripts in that directory. The name of this project will be blog.

$ rails blog
      create
      create app/controllers
      create app/helpers
      create app/models
      create app/views/layouts
      create config/environments
      create config/initializers
      create db
      create doc
      create lib
      create lib/tasks
      create log
      create public/images
... snip ...

The rails command will tell you which files it's creating. When it's finished, you'll be back at the command prompt. Change directory to your new blog directory.

$ cd blog
blog$

As of Rails 2.0, the default database driver is sqlite3. If you have sqlite3 installed and configured, no database configuration is required. For a development system, sqlite3 is recommended as it's the most convenient. For production systems, a faster SQL server such as MySQL is recommended, but you don't have to worry about that just yet, since sqlite3 will be used.

  1. About.com
  2. Computing
  3. Ruby
  4. Ruby on Rails
  5. Generating a Rails Project

©2014 About.com. All rights reserved.