How to generate a rails app with Postgresql as the database?


Make sure you have Ruby

ruby -v

Output


Make sure you have Rails

rails -v

Output


Make sure you have Postgresql

psql --version

Output


Generate the app

rails _6.1.4_ new app_name -d postgresql

Check your database.yml file


Perform database commands

rails db:create
rails db:migrate

Confirm database creation

psql -U postgres -h localhost -d youdemee_development

Output

youdemee_development is the database name.


Done


Celebrate

The It Crowd Birthday GIFs | Tenor


Reach me out


Final thoughts

Thank you for reading this article.

If you have any questions, thoughts, suggestions, or corrections, please share them with us.

We appreciate your feedback and look forward to hearing from you.

Feel free to suggest topics for future blog articles. Until next time!