Ruby on rails 如何修复:PG::ConnectionBad:fe_sendauth:未提供密码

Ruby on rails 如何修复:PG::ConnectionBad:fe_sendauth:未提供密码,ruby-on-rails,postgresql,localhost,pgadmin,Ruby On Rails,Postgresql,Localhost,Pgadmin,我在Ruby on Rails文件夹中 $rails服务器 WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.8.0 ** Invoke db:migrate (first_time) ** Invoke db:load_config (first_time) ** Invoke environment (first_time) ** Execute environment

我在Ruby on Rails文件夹中

$rails服务器

WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.8.0
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
rake aborted!
PG::ConnectionBad: fe_sendauth: no password supplied
/Users/snowflake/.rvm/gems/ruby-2.5.1@global/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/Users/snowflake/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `eval'
/Users/snowflake/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我刚刚在我的新MacMini上安装了Postgresql Server、PGAdmin和堆栈工具。在我的MacBook上有一个postgresql server图标,显示了所有服务器。(这在我的Mac mini上丢失)

PGAdmin正在运行


localhost:3000/welcome/index

作为您在application.yml文件中发布的示例,您没有指定密码:

test:
 adapter: postgresql
 encoding: unicode
 database: pcms_test
 host: localhost
 pool: 5
 username: postgres
 password: 

您需要为您的postgres用户设置密码,并将该密码放在您的数据库中。yml要解决此问题

您尚未在
数据库中提供任何密码。yml
它无法连接到您的PG数据库我以前不需要密码。
test:
 adapter: postgresql
 encoding: unicode
 database: pcms_test
 host: localhost
 pool: 5
 username: postgres
 password: