Creating a New Application
In this lesson, we will learn to create a new Rails application.
We'll cover the following...
When you install the Rails framework, you also get a new command-line tool, rails
, that’s used to construct each new Rails application.
Why do we need a tool to do this? Why can’t we just hack away in our favorite editor and create the source for our application from scratch? Well, that is an option. After all, a Rails application is just Ruby source code. However, Rails does a lot of magic behind the curtain to get our applications to work with a minimum of explicit configuration. To get this magic to work, Rails needs to find all the various components of our application. As we’ll see later, this means we need to create a specific directory structure in which we slot the code we write into the appropriate places. The rails
command creates this directory structure for us and populates it with some standard Rails code.
To create our first Rails application, pop open a shell window and navigate to a place in our filesystem to create our ...