fe_sendauth:没有提供密码

database.yml的:

# 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更改为trust,但仍然出现错误。

不pipe我在database.yml中尝试什么样的组合,当我这样做的时候:

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

我总是得到错误:

fe_sendauth:没有提供密码

我按照这个教程来设置东西:

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.confpostgresql.conf文件进行更改之后,需要重新加载集群以获取更改。

从命令行: pg_ctl reload

从一个数据库中(作为超级用户): select pg_reload_conf();

从PGAdmin:右键单击数据库名称,select“重新加载configuration”

注意:重新加载对于启用存档,更改shared_buffers等的更改是不够的 – 这需要重新启动群集。