I have Fedora installed on my machine with PostgreSQL 9.4 . However, whenever I try to upload the Rails server, this error appears:
FATAL: peer authentication failed for user "api"
However, when running systemctl status postgresql-9.4.service -l on the terminal, this error appears:
Postgresql-9.4.service - PostgreSQL 9.4 database server Loaded: loaded (/usr/lib/systemd/system/postgresql-9.4.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2015-08-21 21:44:11 BRT; 40s ago ExecStart = / usr / pgsql-9.4 / bin / pg_ctl start -D $ {PGDATA} -s -w -t 300 (code = exited, status = 1 / FAILURE) Process: 3414 ExecStartPre = / usr / pgsql-9.4 / bin / postgresql94-check-db-dir $ {PGDATA} (code = exited, status = 0 / SUCCESS)
Aug 21 21:44:06 localhost.localdomain systemd [1]: Starting PostgreSQL 9.4 database server ... Aug 21 21:44:06 localhost.localdomain pg_ctl [3423]: < 2015-08-21 21: 44: 06.558 BRT > LOG: could not connect to IPv4 socket: address already in use Aug 21 21:44:06 localhost.localdomain pg_ctl [3423]: < 2015-08-21 21: 44: 06.558 BRT
TIP: Is another postmaster already running on port 5432? If not, wait a few seconds and try again. Aug 21 21:44:06 localhost.localdomain pg_ctl [3423]: < 2015-08-21 21: 44: 06.558 BRT WARNING: Could not create listening socket for "localhost" Aug 21 21:44:06 localhost.localdomain pg_ctl [3423]: < 2015-08-21 21: 44: 06.558 BRT> FATAL: Could not create any TCP / IP socket Aug 21 21:44:11 localhost.localdomain pg_ctl [3423]: pg_ctl: can not start the server Aug 21 21:44:11 localhost.localdomain systemd [1]: postgresql-9.4.service: control process exited, code = exited status = 1 Aug 21 21:44:11 localhost.localdomain systemd [1]: Failed to start PostgreSQL 9.4 database server. Aug 21 21:44:11 localhost.localdomain systemd [1]: Unit postgresql-9.4.service entered failed state. Aug 21 21:44:11 localhost.localdomain systemd [1]: postgresql-9.4.service failed.
Here's my pg_hba.conf:
# "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust