[英]how to setup PostgreSQL username and password on digitalOcean
您好,我正在嘗試將我的應用替換為數字海洋默認應用,但是當我嘗試運行時,
rails db:setup
我有這個錯誤
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
這是我的database.yml文件
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'] %>
如果您按照此處的步驟操作,它將要求您輸入postgres用戶的密碼,或者您可以創建另一個用戶“ rails”。 然后,您可以使用這些憑據(尤其是密碼)更新database.yml。
該消息非常清楚: fe_sendauth:未提供密碼在生產中訪問Rails控制台並簽出ENV ['APP_DATABASE_PASSWORD']值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.