By default, the Ruby on Rails used the SQLite as the default database. And for this guide, we will start a new Rails project using the PostgreSQL database.
Create a new project 'hakaseapp' with the default database PostgreSQL using the following 'rails' command.
rails new readstore -d postgresql
Now you will get the project directory 'hakaseapp', go to the project directory and edit the database confoiguration 'config/database.yml' using vim editor.
On the development section, add the database configuration as below.
Go to the testing section and add the PostgreSQL database configuration as below.
Save and close.
Next, run the rails command below to generate and migrate the database for our Rails project, and make sure there is no error.
When all setup is complete, start the default puma rails web server using the command below.
rails s -b 0.0.0.0 -p 8080
Now open your web browser and type your server IP address with port '8080' on the address bar.
You will get the default index.html page of the Ruby on Rails.