我在创建带有轨道的脚手架时遇到问题
当我遇到以下问题时,我正在学习教程。
rails new SuperAwesomeApp -d postgresql
rails g scaffold item name:string description:text
.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/
connection_adapters/postgresql_adapter.rb:1216:
in `initialize': fe_sendauth: no password supplied (PG::Error)
如何为rails/postgres提供密码?
对铁轨还是很陌生,所以我很感激你的帮助。
打开你的config/database.yml
。您可能缺少访问此处数据库所需的密码。database.yml 示例
development:
adapter: postgresql
database: database_name
host: 10.0.0.1
port: 1433
username: username
password: passsword
您真正需要告诉的另一件事是主机。如果是localhost,那么在config/database.yml中,include;
host: localhost