Search⌘ K

Creating a New Rails Project

Explore how to create a new Rails project with the rails new command. Understand the essential Rails directory structure and the purpose of key files to prepare for application development.

We'll cover the following...

Creating a new project

Rails comes equipped with scripts called generators that will automatically create everything you need to start working on a new project. To create a new application, you must invoke the new generator, which will act as the foundation for your project. This generator will save you time and effort by ensuring that you will write much less code.

To use the new generator we will run the following command:

rails new my_project

This will set up a new project in the my_project directory and set up the application structure for Rails.

Let’s take a look at exactly what this command created.

Project file/folder structure (incomplete)
Project file/folder structure (incomplete)

We will be taking a look at the essential subdirectories later, but for now, you should have ...