database.yml:fe_sendauth: không có mật khẩu được cung cấp
# 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
Tôi đã thay đổi phương pháp trong ba dòng đầu tiên từ md5 để tin tưởng, nhưng tôi vẫn nhận được lỗi .
Và không có vấn đề gì kết hợp của những điều tôi cố gắng trong database.yml, khi tôi làm:
~/rails_projects/sample_app4_0$ bundle exec rake db:create:all
tôi luôn luôn nhận được lỗi:
fe_sendauth: no password supplied
Tôi đi theo hướng dẫn này để có được những điều thiết lập :
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
Và bạn đã tải lại tệp pg_hba.conf của mình sau khi thực hiện thay đổi? – bma
@bma, Làm thế nào để bạn tải lại? Cách duy nhất tôi có thể kết nối với máy chủ là sử dụng pgAdmin3 (trong thư mục 9.2). Tôi chọn máy chủ, nhấp chuột phải, sau đó chọn Connnect. Vì vậy, trong một nỗ lực để tải lại các tập tin conf, tôi bị ngắt kết nối từ máy chủ trong pgAdmin3, sau đó kết nối lại. – 7stud
Bạn có thể đưa ra một truy vấn: 'chọn pg_reload_conf()' làm superuser, hoặc trong pgadmin bạn có thể nhấp chuột phải vào tên db, sau đó nhấn "Reload Configuration" (tôi nghĩ đó là những gì có, tôi không dùng pgadmin) – bma