2013-08-01 1 views
38

database.yml을 공급하지 :fe_sendauth : 암호가

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
development: 
    adapter: postgresql 
    encoding: utf8 
    database: sampleapp_dev #can be anything unique 
    #host: localhost 
    #username: 7stud 
    #password: 

    #adapter: sqlite3 
    #database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: postgresql 
    encoding: utf8 
    database: sampleapp_test #can be anything unique 
    #host: localhost 
    #username: 7stud 
    #password: 
    #adapter: sqlite3 
    #database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: postgresql 
    database: sampleapp_prod #can be anything unique 
    #host: localhost 
    #username: 7stud 
    #password: 
    #adapter: sqlite3 
    #database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

있는 pg_hba.conf : 나는 신뢰의 MD5에서 처음 세 줄의 방법을 변경,하지만 난 여전히 오류가

# TYPE DATABASE  USER   ADDRESS     METHOD 

# "local" is for Unix domain socket connections only 
local all    all          trust 
# IPv4 local connections: 
host all    all    127.0.0.1/32   trust 
# IPv6 local connections: 
host all    all    ::1/128     trust 
# Allow replication connections from localhost, by a user with the 
# replication privilege. 
#local replication  postgres        md5 
#host replication  postgres  127.0.0.1/32   md5 
#host replication  postgres  ::1/128     md5 

. 난 항상 오류 얻을

~/rails_projects/sample_app4_0$ bundle exec rake db:create:all 

: 내가 무엇을 할 내가 database.yml을에 시도 것들의 조합

와 상관없이

fe_sendauth: no password supplied

나는 것들을 설치를 얻을이 튜토리얼을 따라 :

https://pragtob.wordpress.com/2012/09/12/setting-up-postgresql-for-ruby-on-rails-on-linux

Mac OSX 10.6.8 
PostgreSQL 9.2.4 installed via enterpriseDB installer 
Install dir: /Library/PostgreSQL/9.2 
,536,913,632 10
+1

그리고 변경 한 후에 pg_hba.conf 파일을 다시로드 했습니까? – bma

+0

@bma, 어떻게 다시로드합니까? 내가 서버에 연결할 수 있었던 유일한 방법은 9.2 디렉토리에서 pgAdmin3을 사용하는 것이다. 서버를 선택하고 마우스 오른쪽 버튼을 클릭 한 다음 연결을 선택합니다. 따라서 conf 파일을 다시로드하려고 시도하면서 pgAdmin3의 서버에서 연결을 끊었다가 다시 연결되었습니다. – 7stud

+2

수퍼 유저로'select pg_reload_conf()'를 실행하거나 pgadmin에서 db 이름을 마우스 오른쪽 버튼으로 클릭 한 다음 "Reload Configuration"을 클릭하면됩니다 (필자는 그렇게 생각합니다. pgadmin을 사용하지 않습니다) – bma

답변

43

pg_hba.conf 또는 postgresql.conf 파일을 변경 한 후에는 클러스터를 다시로드하여 변경 사항을 적용해야합니다. (수퍼 유저로)는 DB 내에서 pg_ctl reload

: PGAdmin에서 select pg_reload_conf();

: 명령 줄에서

마우스 오른쪽 단추로 클릭 한 DB 이름은 "새로 고침 구성"

주를 선택 : 다시로드를 보관 활성화, 변경 shared_buffers 등의 변경에는 충분하지 않습니다. 클러스터를 다시 시작해야합니다.

+1

다음과 같은 질문이 있습니다. 제가 아는 한, 어떤 서버도 시작하지 않았습니다. 내가 한 유일한 일은 Mac OSX 설치 프로그램을 사용하여 포스트 시즌을 설치하는 것입니다. 그런 다음 행운이없는 포스트 그레스를 사용하는 방법을 알아 내려고 애 쓰면서 몇 시간을 보냈습니다. 방금 /Library/PostgreSQL/9.2 디렉토리에서 pgAdmin3을 발견 했으므로 클릭했습니다. 그러면 서버는 어떻게 시작 되었습니까? 그리고 그것을 멈출 필요가 있습니까? – 7stud

+2

설치 프로그램이 설치를 완료 한 후 시작했을 가능성이 높습니다 (본인이 보았던 대부분의 설치 프로그램/패키지) – bma

+0

중지해야합니까? 어떻게해야합니까? 나는 커맨드 라인을 사용하는 데 익숙하기 때문에 설치 프로그램을 좋아하지 않습니다. – 7stud

관련 문제