What `rails new` generates

Free preview 2 min to read

Before article existed, something had to build the folders

Rails MVC overview ended with app/models/article.rb, app/controllers/articles_controller.rb and a view, three files working together. Those files and their folders don't appear on their own. Something has to create app/models/, app/controllers/, app/views/, a Gemfile, database settings, a web server config and dozens of other pieces before you write a line of Article. That something is one command: rails new.

rails new blog

This one line produces a working tree of over a hundred files and folders, already wired together. You get a Gemfile, an initialized git repository, a Puma configuration, database settings, and the MVC folders from the previous course, app/models, app/views and app/controllers, waiting for code.

Not a Rails-only idea

Generating a project skeleton from one command isn't unique to Rails. Django has django-admin startproject, Angular has ng new, and React apps use npm create vite@latest (React's own create-react-app was retired in 2025). Rails' version stands out for the philosophy behind its defaults, the convention over configuration idea from The Rails way. rails new doesn't ask fifty setup questions; it picks sensible defaults and gets you to working code fast.

What this course covers

This course is a map of the generated app. Lesson 2 tours the top level, and lesson 3 goes inside app/, linking back to the MVC course. Lesson 4 goes inside config/. Lesson 5 covers flags that change what gets generated, and lesson 6 covers git and first-day setup. Lesson 7 ties it together with one real command.

Key takeaways

  • rails new generates a complete, working skeleton in one command, before any app-specific code exists.
  • This project runs on Ruby 4.0 and Rails 8.1; ruby -v and rails -v show the exact versions.
  • Other frameworks have generators too; Rails' defaults follow convention over configuration.
  • This course maps the structure; later courses (Bundler & Gemfile, Rails server & Puma, Security: credentials and more) go deep on single pieces.
Lesson 1 of 7 · free

Keep going with lesson 2

The top-level layout

Every generated app shares one top-level layout, where app/ holds app code and the rest is infrastructure.

A free account also gives you the quizzes, your progress and notes, and the discussion.

Type to start searching...