How Do I Deploy A Rails App With Postgres?

Hello,

I’m revisiting Rails after a hiatus that went a few years.

If I recall correctly, services such as Heroku used to simply accept a Github repo and would spin up your app. It was easy peasy. You could just open up the console to initiate commands.

With Rails 8 it seems like it’s not so simple. From what I understand, the database now needs to be spun up as a separate service?

I have tried both Heroku and Koyeb and both services keep giving me database errors. Everything from “bad PG connection” to “bad URI” to “unable to parse database name” and everything else you can imagine.

Can anyone please lend a helping hand on how I’m supposed to spin up my app and have a simple Postgres database connected to it?

Thank you!

Try this tutorial: How to Deploy a Rails Application and Add Authentication using Devise - Koyeb :slight_smile:

Hey everyone. I solved the problem. Turns out the issue was extremely simple (though very frustrating).

Long story short: there’s an errata in the Koyeb documentation.

See the erb tag below that Koyeb instructs you to copy/paste into your config file? That second equals sign isn’t supposed to be there. I don’t even want to admit how long it took me to notice it.

1 Like

Glad it works now!
Maybe @alisdair or another team member could update the docs to prevent others from hitting the same issue.

Thanks for chiming in and helping!

1 Like