Setting Up a Rails Project
Learn how to create and configure a new Rails application.
Setting Up a Rails Project is a free Ruby Academy lesson on CoddyKit — lesson 2 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ruby Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.
1
Setting Up a Rails Project
Before building a Rails application, you need to set up your development environment.
In this lesson, you will learn how to install Rails and create a new project.

2
Installing Ruby and Rails
Ensure you have Ruby installed, then install Rails using the following command:
gem install rails3
Creating a New Rails Project
Use the rails new command to create a new application.
rails new my_app4
Understanding the Rails Project Structure
A Rails project consists of several important folders:
- app/: Contains models, views, and controllers.
- config/: Stores configuration files.
- db/: Manages database migrations and schema.
5
Running the Rails Server
Start your Rails application using the built-in server:
cd my_app
rails server6
Using the Rails Console
The Rails console allows you to interact with your application from the command line.
rails console7
Generating a Controller and View
Create your first controller and view with the following command:
rails generate controller Home index8
9
Setting Up the Database
Run the following command to create the database for your Rails app:
rails db:create10
Congratulations!
You have learned how to set up a Rails project and run your first application.
Next, you will learn about Models, Views, and Controllers.

Frequently asked questions
Is the “Setting Up a Rails Project” lesson free?
Yes — the full text of “Setting Up a Rails Project” is free to read here on the web, and the Ruby Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ruby Academy course, upgrade to CoddyKit PRO.
What will I learn in “Setting Up a Rails Project”?
Learn how to create and configure a new Rails application. You practise Ruby Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Ruby Academy?
No prior experience is required. Ruby Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 3, so you can start here or from the beginning and move at your own pace.
How long does the “Setting Up a Rails Project” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Ruby Academy lesson?
Yes. Every Ruby Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What is Ruby on Rails?
- Setting Up a Rails Project
- Models, Views, and Controllers