railway run - DATABASE_URL vs DATABASE_PUBLIC_URL
allcentury
HOBBYOP

a year ago

Wondering if this is a bug.

I've got a rails app deployed and it's using DATABASE_URL and it all works (migrations, jobs, etc).

If I then use:

railway run bash

I look at

printenv

And I see DATABASE_URL set to the internal value. However if I run

rails c
User.count

it times out and can't reach postgres.

If instead, I run:

DATABASE_URL= rails c
User.count

it works. So i'm wondering why railway run isn't in the private network?

3 Replies

allcentury
HOBBYOP

a year ago

project id: 366ad74c-a280-40ef-bebb-04ef72d94ee4


a year ago

please know that railway run, runs the commands locally


allcentury
HOBBYOP

a year ago

ah, that explains it


Loading...