简体   繁体   中英

Can't Create A Scaffold using Rails - No password error

I m having trouble creating a scaffold with rails

I was following a tutorial when I ran into the following problem.

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)

How do I supply rails / postgres with a password?

Still pretty new to rails, so I appreciate the help.

Open up you config/database.yml . You are probably missing a password required to access the database here. Example of database.yml

development:
  adapter: postgresql
  database: database_name
  host: 10.0.0.1
  port: 1433
  username: username
  password: passsword

Another thing that you really need to tell is the host. If it is localhost, then in your config/database.yml, include;

    host: localhost

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM