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?
In my case, I initially planned to simply copy everything to the production server. However, I came across Kamal 2, which seemed quite straightforward and easy to use, so I decided to give it a try. I have to say, it was a nightmare of errors—connection issues, permission errors, namespace problems, secret-related errors, you name it. I spent about 20 hours non-stop battling Kamal 2, with ChatGPT and Grok on fire and an infinite number of browser tabs open.
I was ready to throw everything out the window, but in the end, it worked! Once I sorted out all the Kamal configuration issues and fixed the app itself, the deployment became incredibly smooth and easy. Now, I just run a three-line bash script, bv_deploy.production.sh, and it’s done.
So I will tell you to check deeply Kamal2 to do all the deployment
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.
Using Kamal 2, but as others have said, it is not quite there yet. That is just the territory of handling your own infra, but I do believe it is worth it.
Highly recommend deploying very soon after starting a greenfield project. Keep your Dockerfiles up to date with your app. It will be easier to add stuff one by one (redis, external libraries, etc) than all at once when you’re ready to deploy, and you’ll have experience with issues that can arise. For example, it was surprising to me how much memory was consumed by Solid trifecta. Kamal runs two instances of the container for gap-less deployments, so I would sometimes get OOM errors, which Kamal would not know anything about.