Postgresql в rails проекте

Пытаюсь сделать деплой приложения на Heroku. Для этого заменил бд с sqlite3 на postgresql, однако при вводе команды bin/rails db:create консоль выдает следующее: We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml.

To resolve this issue:

  • Did you create the database for this app, or delete it? You may need to create your database.
  • Has the database name changed? Check your database.yml config has the correct database name.

To create your database, run:

    bin/rails db:create

Couldn't create 'twitter_development' database. Please check your configuration. rails aborted! ActiveRecord::NoDatabaseError: We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml.

To resolve this issue:

  • Did you create the database for this app, or delete it? You may need to create your database.
  • Has the database name changed? Check your database.yml config has the correct database name.

To create your database, run:

    bin/rails db:create

Caused by: PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: ВАЖНО: роль "arseny" не существует

В Gemfile есть gem 'pg' и я полностью убрал sqlite3 (хотя его наличие ни на что не влияло). В gemfile.lock также нет упоминаний sqlite3

database.yml:

default: &default

adapter: postgresql

encoding: unicode

pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development: <<: *default database: twitter_development

test: <<: *default database: twitter_test

production: <<: *default

database: twitter_production

username: twitter_app

password: <%= ENV['TWITTER_DATABASE_PASSWORD'] %>

host: localhost port: 5432


Ответы (0 шт):