我最近买了一台新机器,现在想在Github上完成我的项目.我很好奇如何在本地机器上正确设置Postgres数据库.我在Ubuntu(12.04)上安装了postgresql
、pgadmin3
和libpq-dev
.
我撤销了这个项目:
git clone https://github.com/thebenedict/cowsnhills.git
然后运行:
bundle
当我 run 时:
rake db:create && rake db:schema:load
我得到了这个错误:
rake db:create && rake db:schema:load
FATAL: password authentication failed for user "cnh"
FATAL: password authentication failed for user "cnh"
....
config/database.yml
文件如下所示:
development:
adapter: postgresql
encoding: unicode
host: localhost
database: cnh_development
pool: 5
username: cnh
password: cnh
test:
adapter: postgresql
encoding: unicode
host: localhost
database: cnh_test
pool: 5
username: cnh
password: cnh
production:
adapter: postgresql
encoding: unicode
host: localhost
database: cnh_production
pool: 5
username: cnh
password: cnh
设置Postgres数据库的正确方法是什么,这样我就可以在本地机器上运行这个项目了?
现在,当我启动Rails服务器时,我得到: