Can’t do anything with Heroku using Rails and Postgres. It was working a few days ago and I upgraded from the Free plan to the Mini postgres plan and from the Free dyno to the Eco dyno.
I get this error. I’ve already tried create a user, role, and database, named vwwaspiwhqdnqp and gave it a password. I also tried setting the credentials via heroku pg:credentials commands. Not sure what is wrong. Thanks for your help!
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
production: <<: *default
database: vwwaspiwhqdnqp
host: localhost
port: 5432
username: samtimus
password: '123'
url: <%= ENV['DATABASE_URL'] %>
heroku pg:promote DATABASE_URL -a ecommercesam
results in
Unknown database: DATABASE_URL. Valid options are: HEROKU_POSTGRESQL_GOLD_URL
The error when doing heroku pg:promote HEROKU_POSTGRESQL_GOLD_URL -a ecommercesam
"Ensuring an alternate alias for existing DATABASE_URL… done Not found"
Thanks for your help!
2
Answers
I had to point the db to a different name according to the db settings I have on heroku! Thanks for your help!
Why do you have multiple
production
anddevelopment
configurations? The closest production configuration here is the one that’s nested inside yourdevelopment
configuration. But you won’t be able to usetrust
authentication on Heroku.Move that configuration outside of
development
and overwrite the otherproduction
configuration. Make sure not to copy thePOSTGRES_AUTH_METHOD
.And don’t use
HEROKU_POSTGRESQL_GOLD_URL
directly. If that’s the database you wish to use, promote it, then useDATABASE_URL
instead.