2015-09-17 13 views
7

Próbuję uruchomić PostgreSQL dla RoR na moim nowym macu (jestem nowicjuszem). Postępowałem zgodnie z przewodnikiem instalacji, ale nie mogę go poprawnie uruchomić. Znalazłem podobne pytania, ale te nie pomogły. Otrzymuję następujący błąd w cmd "postgres".Postgres nie wie gdzie znaleźć konfigurację serwera

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. 

jednak kiedy mogę ustawić -D wywołania przez

postgres -D /usr/local/var/postgres 

dostaję kolejny błąd

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

Próbowałem użyć 'zabić 6621', ale to po prostu wydaje się uruchamia kolejnego postmastera na innym PID. Próbowałem zostały również usunięcie PID i działa

postgres -D /usr/local/var/postgres 

otrzymuję następujące błędy:

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 

Czy ktoś wie, co robię źle?

+0

Możliwy duplikat [PostgreSQL nie wie, gdzie znajduje się plik konfiguracyjny serwera] (http://stackoverflow.com/questions/39743313/postgres-does-not- know-where-to-find-the-server-configuration-file) –

Odpowiedz

5

Zazwyczaj po zainstalowaniu postgreara w systemie tworzona jest usługa/demon, więc nie ma potrzeby ręcznego uruchamiania serwera. Otrzymujesz błąd, ponieważ usługa jest już uruchomiona.

spróbuje połączyć się z bazą danych przy użyciu psql

Powiązane problemy