Home > OS >  Rails, Postgres, Heroku: Cannot Commit, Migrate, or Seed To Heroku
Rails, Postgres, Heroku: Cannot Commit, Migrate, or Seed To Heroku

Time:12-26

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!

CodePudding user response:

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.

CodePudding user response:

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

  • Related