나는 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은 완전히 새로운 것입니다. 편집에 게시해야하는 다른 파일이 있으면 알려주십시오.
postgres가 올바르게 실행되고 있는지 확인 했습니까? 어떤 OS를 사용하고 있습니까? –
컴퓨터에 postgresql이 설치되어 실행되고 있습니까? –
@RockwellRice. 네, pgAdmin4가 열려 있지만 서버가 없습니다. – Owen