2017-12-24 17 views
0

나는 postgresql 데이터베이스를 사용하는 레일 애플 리케이션이 있습니다. 내가 처음 사용한 것은 이번이 처음이다. postgresql이 설치되고 pgAdmin이로드되지만 모든 서버에 연결되지 않습니다. 이상한 것은 내가 로컬 호스트에 연결 한 것입니다 : 3000 전에이 응용 프로그램과 함께,하지만 난 연결하려고 할 때 지금은 다음과 같은 오류 메시지가 :postgresql을 사용할 때 레일즈 앱을 서버에 어떻게 연결합니까?

PG::ConnectionBad 

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? 

Extracted source (around line #56): 

    ### Convenience alias for PG::Connection.new. 
    def self::connect(*args) 
     return PG::Connection.new(*args) 
    end 

database.yml을 파일 :

default: &default 
    adapter: postgresql 
    pool: 5 
    timeout: 5000 
    encoding: unicode 
    username: postgres 
    password: #not sure what to put here 

development: 
    <<: *default 
    database: nutri_development 

test: 
    <<: *default 
    database: nutri_test 

production: 
    <<: *default 
    database: nutri_production 
    prepared_statements: false 
    encoding: unicode 

지금까지 저는 postgresql을 설정하고 가이드를 읽으면서 youtube 비디오를 보았습니다.하지만 제 경우에는 서버 연결과 같은 것들이 누락되었습니다. 나는이 질문에 대한 답을 찾지 못했다. 나는이 부분에서 완전히 분실되어 있으므로 단계별로 조언을하십시오. postgresql은 완전히 새로운 것입니다. 편집에 게시해야하는 다른 파일이 있으면 알려주십시오.

+0

postgres가 올바르게 실행되고 있는지 확인 했습니까? 어떤 OS를 사용하고 있습니까? –

+0

컴퓨터에 postgresql이 설치되어 실행되고 있습니까? –

+0

@RockwellRice. 네, pgAdmin4가 열려 있지만 서버가 없습니다. – Owen

답변

0

당신은 PostgreSQL을 설치하는 경우 다음이

enter image description here

처럼 아이콘을 클릭하면 이전에 암호를 설정하지 않은 경우, 다음 소프트웨어는 database.yml을 파일에 다음이를 사용하는 암호를 설정하도록 요청 암호를 요구하지 것은 다음 수동으로 만들 수 있다면, 페이지 관리 대시 보드의 왼쪽에있는 서버를 열려면 클릭 server->PostgreSQL->Login/Group->postegres

enter image description here

마우스 오른쪽 버튼을 클릭 한 다음 속성으로 이동하여 Definition 탭을 클릭 한 다음 비밀번호를 설정하십시오.

끝났습니다!

도와 드리겠습니다.

+0

죄송합니다. 링크가 작동하지 않았습니다. – Owen