skip to Main Content

I am trying to connect a rails app to Postgresql db locally and I get that message when I run db:create.
here is my database.yml file:

default: &default
  adapter: postgresql
  encoding: unicode
  username: postgres
  password: alex70gou
  host: localhost

  # For details on connection pooling, see Rails configuration guide
  # https://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
  <<: *default
  database: artur_development

I have tried ALTER USER postgres PASSWORD 'alex70gou'; and get the same result, and other things including uninstalling and reinstalling postgresql.

2

Answers


  1. sudo -u postgres psql

    create user deployer with password ‘deployer’;
    alter user deployer superuser;

    username: deployer
    password: deployer

    Don’t use system user for app connections

    Login or Signup to reply.
  2. Try psql -U postgres

    postgres=#password

    You’ll be prompted to enter a new password.

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