0

When trying to run rails db:create I'm getting this error message:

FATAL:  role "xozi" does not exist
Couldn't create 'MyApp_development' database. Please check your configuration.
rails aborted!
PG::ConnectionBad: FATAL:  role "xozi" does not exist

Here's my database.yml:

default: &default
  adapter: postgresql
  encoding: unicode
  # 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: MyApp_development

test:
  <<: *default
  database: MyApp_test

production:
  <<: *default
  database: MyApp_production
  username: MyApp
  password: <%= ENV['MYAPP_DATABASE_PASSWORD'] %>

Why can't the rails command create the database? This error message is the same for rake and rails

xozaima
  • 1
  • 2

0 Answers0