skip to Main Content

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


  1. Chosen as BEST ANSWER

    I had to point the db to a different name according to the db settings I have on heroku! Thanks for your help!


  2. Why do you have multiple production and development configurations? The closest production configuration here is the one that’s nested inside your development configuration. But you won’t be able to use trust authentication on Heroku.

    Move that configuration outside of development and overwrite the other production configuration. Make sure not to copy the POSTGRES_AUTH_METHOD.

    And don’t use HEROKU_POSTGRESQL_GOLD_URL directly. If that’s the database you wish to use, promote it, then use DATABASE_URL instead.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search