connect other users to the database?

1

with my group we are working rather learning to work with rails and postgresql, the project was uploaded to github, they downloaded it but when starting the server (rails s) it appears that they do not have user permission in the database .

How can I give them permission?

this appears to them

  

FATAL: Peer authentication failed for user «diegomaui»   Extracted source (around line # 671):

     

connected server's characteristics. def connect @connection = PGconn.connect (@connection_parameters)

     

configure_connection rescue :: PG :: Error = > error
  if error.message.include? ("does not exist")

    
asked by mariansa 08.12.2016 в 17:13
source

1 answer

1

That seems more a PostgreSQL problem than Ruby on Rails, most likely they need to create a PostgreSQL user on the local machine, from a psql console or from PgAdmin they can execute: CREATE USER diegomaui WITH PASSWORD 'jw8s0F4' CREATEDB; , where they obviously have to Place the same password that appears in config/database.yml of your Ruby on Rails project.

You also have to make sure you have correctly configured PostgreSQL, look for the file pg_hba.conf , in Ubuntu it is in a directory similar to /etc/postgresql/9.6/main/pg_hba.conf .

After you meet pg_hba.conf, change the following to the end of the file:

host    all             all             127.0.0.1/32            md5

host    all             all             ::1/128                 md5

By

host    all             all             127.0.0.1/32            trust

host    all             all             ::1/128                 trust
    
answered by 10.12.2016 / 14:30
source