There is a ready application with sqlite3 data transfer is not provided. You need to connect PostgreSQL, create a new database and make migrations. PostgreSQL installed. Created user

$ sudo -u postgres psql postgres-# CREATE ROLE pguser LOGIN ENCRYPTED PASSWORD 'passwd' NOSUPERUSER NOINHERIT CREATEDB NOCREATEROLE; 

I look in pgAdmin

enter image description here

I go to database.yml

 development: pool: 5 timeout: 5000 adapter: postgresql database: newdb username: pguser password: passwd 

Naturally hem pg stands.

Run db: create or db: setup

 $ rake db:setup FATAL: Peer authentication failed for user "pguser" Couldn't create database for {...} 

Added pg_hba.conf

enter image description here

  • What is pg_hba.conf? This config describes which users can connect from where and with which authentication method. Judging by "Peer authentication failed", postgresql tries to use peer authentication, i.e. The client must be authorized in the OS under this login. And you probably have no such user at all. - Small
  • @ Small Added config. Changed local all all peer => md5 earned, thanks. - Sergei R
  • one
    Possible duplicate question: Problem with database migration to postgres - D-side

1 answer 1

In addition to creating a user in PosqtgreSQL, it is often necessary to check pg_hba.conf and change it if necessary. This config describes which users from where can connect and which authentication method should be used to verify connections.

Judging by "Peer authentication failed", postgresql tries to use peer authentication, i.e. The client must be authorized in the OS under this login. And you probably have no such user at all. For password authentication, the md5 method is usually used.