2015-09-17 28 views
7

Sto cercando di eseguire PostgreSQL per RoR sul mio nuovo Mac (sono un principiante). Ho seguito la guida di installazione, ma non riesco a farlo funzionare correttamente. Ho trovato domande simili ma quelle non hanno aiutato. Ottengo il seguente errore sul cmd 'postgres'.postgres non sa dove trovare la configurazione del server

postgres does not know where to find the server configuration file. 
You must specify the --config-file or -D invocation option or set the 
PGDATA environment variable. 

tuttavia quando ho impostato la mia invocazione -D attraverso

postgres -D /usr/local/var/postgres 

ottengo un altro errore

FATAL: lock file "postmaster.pid" already exists 
HINT: Is another postmaster (PID 6621) running in data directory  
"/usr/local/var/postgres"? 

ho provato ad usare 'kill 6621', ma poi sembra solo per avviare un altro postmaster su un PID diverso. Ho anche provato a rimuovere PID e funzionante

postgres -D /usr/local/var/postgres 

Ottengo i seguenti errori:

LOG: could not bind IPv6 socket: Address already in use 
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 
LOG: could not bind IPv4 socket: Address already in use 
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 
WARNING: could not create listen socket for "localhost" 
FATAL: could not create any TCP/IP sockets 

qualcuno sa quello che sto facendo male?

+0

Eventuali duplicati di [postgres non sa dove trovare il file di configurazione del server] (http://stackoverflow.com/questions/39743313/postgres-does-not- so-dove-a-trovare-il-server-configuration-file) –

risposta

5

In genere, quando viene installato Postgres, nel sistema viene creato un servizio/daemon, quindi non è necessario avviare manualmente il server. Stai ricevendo l'errore perché il servizio è già in esecuzione.

Provare a connettersi al database utilizzando psql

Problemi correlati