I have a web service and postgresql database up and running and I’m trying to run rails db:migrate as part of the build and getting an error reaching postgresql. I have the DATABASE_URL variable setup on the web service but when I run “rails db:migrate” it seems that it’s trying to attach to a DB On the local machine. I have tried “bundle exec rake db:migrate” as well and tried them as part of the build and through the interactive shell. They all produce the same error.
I think I saw you resolved this on your support ticket - can you share what the resolution was for the wider audience?
Yes, the database.yml had the default rails config. I had the postgresql url in an environment variable. It appears that Rails was not overriding the config with the env value. Once I updated the config file to read the env variable it worked.