简体   繁体   中英

how to setup PostgreSQL username and password on digitalOcean

Hello I am trying replace my app with the digital Ocean default App but when i try to run,

rails db:setup

i have this error

fe_sendauth: no password supplied
Couldn't create database for {"adapter"=>"postgresql", 
"encoding"=>"unicode", "pool"=>5, "host"=>"localhost", 
"username"=>"rails", "password"=>nil, 
"database"=>"realestate_development"}
rails aborted!
PG::ConnectionBad: fe_sendauth: no password supplied

Here is my database.yml file

pool: 5
host: localhost
username: rails
password: <%= ENV['APP_DATABASE_PASSWORD'] %>

development:
 <<: *default
 database: realestate_development

test:
 <<: *default
 database: realestate_test

production:
 <<: *default
 database: realestate_production
 username: rails
 password: <%= ENV['APP_DATABASE_PASSWORD'] %>

If you follow the steps here , it will ask you for password for postgres user or you could create another user, "rails". Then you can update your database.yml with those credentials, especially the password.

该消息非常清楚: fe_sendauth:未提供密码在生产中访问Rails控制台并签出ENV ['APP_DATABASE_PASSWORD']值。

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