2012-06-06 2 views
3

방금 ​​작업을 시작한 프로젝트에서 Ruby 환경에서 루비를 설정하려고했습니다. 내가 루비 1.9.3 설치 한 우분투 (12)에 3.2과 PostgreSQL 9.1.4 레일, 나는 갈퀴 DB를하려고하면 만들 :ruby ​​on rail에서 postgresql에 로컬로 연결할 수 없습니다.

/var/lib/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `initialize': could not connect to server: No such file or directory (NameError) 
Is the server running locally and accepting 
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 

내가 다음에 추가 :

모두 내가 메시지가 호스트 : localhost를

포트 : 5432 나 DB를하자 내 database.yml을 파일에

: 이동,하지만 로컬 레일 서버를 실행할 때 여전히 같은 오류가 모든 및 DB : 만듭니다.

저는 postgresql 서버가 실행되고 있는지 확인했습니다 (이전에 레이크가 작동 한 이후로 실행되고 있다는 것도 알고 있습니다). 그리고 postgresql을 새로 설치하려고 시도했습니다. 이 작품을 만들기 위해 무엇을 놓칠 수 있습니까?

답변

2

Postgres 서버가 실행되고 있습니까? 당신이 ps -aef|grep postgres을 할 경우,이 같은 표시되어야합니다 또한

[[email protected] ~]# ps -aef|grep 'postgres' 
postgres 5963 5475 0 21:28 ?  00:00:00 /usr/postgresql/bin/postmaster -D <your postgres directory> 
postgres 5972 5963 0 21:28 ?  00:00:00 postgres: writer process       
postgres 5973 5963 0 21:28 ?  00:00:00 postgres: wal writer process      
postgres 5974 5963 0 21:28 ?  00:00:00 postgres: autovacuum launcher process    
postgres 5975 5963 0 21:28 ?  00:00:00 postgres: stats collector process     
admin  6750 6607 0 21:30 ttyS0 00:00:00 grep postgres 
+0

를, 당신의 포스트 그레스 서버는 표준 설정이 있습니까? – rmk

+0

몇 분 전까지 표준 구성이 있었지만, http://askubuntu.com/을 읽은 후 postgresql.config에서 unix_socket_directory = '/var/run/postgresql/.s.PGSQL.5432'로 수정했습니다. 질문/50621/can not-connect-to-postgresql-on-port-5432. 또한, 설정을 변경하고 재시작하기 전에 ps -aef | grep postgres를 실행했을 때 나는 그렇게 보였지만 지금은 어떤 프로세스도 보지 못했습니다. 이제 레일 서버를 실행할 때 연결이 거부되었다는 오류가 발생하고 TCP/IP 포트 5432에서 실행되고 있는지 확인하십시오. – FlyingCube

+0

postgres 구성에서 -h localhost 옵션을 사용 했습니까? 그렇지 않다면 언급 한 오류가 발생합니다. – rmk

관련 문제