From the course: Installing and Running Ruby on Rails 6

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Configure the project to use a database

Configure the project to use a database - Ruby on Rails Tutorial

From the course: Installing and Running Ruby on Rails 6

Start my 1-month free trial

Configure the project to use a database

- [Instructor] In this movie, we'll learn to configure our new Ruby on Rails project so that it can use a database. We installed MySQL earlier, but we haven't actually created a database, and we haven't told our Ruby on Rails project which database it should connect to. so we're going to do those two steps. Before we do that, let's look in the project in the config directory for a file called database.yml. YML is a YAML file, it's a simple configuration file that we're going to use to provide the configuration to connect to the database. I want you to notice a few things about this file. First is there's configuration called default, and that includes a username and a password. Don't worry about the other options that are there, notice though that it does say that the adapter is mysql2, that's the mysql2 gem that we installed earlier. Notice then that there's another configuration here called development, that corresponds…

Contents