Creating a New Application
Explore how to create a new Rails application using the rails command-line tool, understand the generated directory structure, and start the built-in web server to run your app. This lesson helps you set up a working environment for Rails development and introduces essential debugging and configuration steps.
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 application’s directory structure. In this example, we’ll be creating our projects in a directory called work ...