Not able to verify rails app is connected to correct postgres database


I’ve been struggling to migrate a rails app from heroku.

I’ve got the application running, however I can’t verify that it’s connected to the correct database application. I’ve tried connecting to start a rails console session but it just hangs. I previously posted this (Starting a rails console session fails) and it was never resolved as I was never able to connect, it still hangs.

I’ve successfully migrated the postgres data into a new application cluster, and tried attaching (flyctl postgres attach · Fly Docs), and $DATABASE_URL is set and visible, but for some reason it’s still not working. Any tips?

If you want help, you are going to have to give us a bit more to go on…

Previously I asked what was in your logs and speculated that you might be running out of memory. No response.

Now your app is running, but you can’t verify… what, exactly?

Meanwhile since your last post, a new feature has been added: Easily run a console in a new machine with fly console - try it out!

Hello, how do I get produce a database url from a postgres machine, so that I can manually attach a postgres machine.

To keep a long story short, I’ve had to jump through a number of hoops to rename and clone a table on my postgres machine. It’s messy.

Basically, I just need to manually set an env var for DATABASE_URL on my app machine, but not sure how to get the public database url from the postgres app.

Nevermind, I managed to find the --database-name flag on flyctl postgres.

This can be closed.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.