的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:
# 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
我改變的方法,從MD5信任的前三行,但我仍然得到錯誤。
無論什麼事情我嘗試在database.yml中,當我做組合:
~/rails_projects/sample_app4_0$ bundle exec rake db:create:all
我總是得到錯誤:
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
你做了改變後重新載入你的pg_hba.conf文件? – bma
@bma,你如何重新加載它?我能夠連接到服務器的唯一方法是使用pgAdmin3(在9.2 dir中)。我選擇服務器,右鍵單擊,然後選擇Connnect。因此,在嘗試重新加載conf文件時,我在pgAdmin3中從服務器斷開連接,然後重新連接。 – 7stud
您可以發出查詢:'select pg_reload_conf()'作爲超級用戶,或者在pgadmin中,您可以右鍵單擊數據庫名稱,然後單擊「重新加載配置」(我認爲這樣做,我不使用pgadmin) – bma