Ruby on rails rake db:为用户创建密码身份验证失败

Ruby on rails rake db:为用户创建密码身份验证失败,ruby-on-rails,ruby,authentication,Ruby On Rails,Ruby,Authentication,运行命令rake db:create时,系统抛出postgresql身份验证失败 致命:用户“postgres”的密码身份验证失败 无法为{“适配器”=>“postgresql”,“编码”=>“unicode”,“池”=>5,“用户名”=>“postgres”,“密码”=>“密码”,“超时”=>5000,“主机”=>“本地主机”,“数据库”=>“rails-sample-guestbook-master\u开发”} 雷克流产了! database.yml文件 default: &def

运行命令
rake db:create
时,系统抛出
postgresql身份验证失败

致命:用户“postgres”的密码身份验证失败
无法为{“适配器”=>“postgresql”,“编码”=>“unicode”,“池”=>5,“用户名”=>“postgres”,“密码”=>“密码”,“超时”=>5000,“主机”=>“本地主机”,“数据库”=>“rails-sample-guestbook-master\u开发”}
雷克流产了!
database.yml文件

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5
  username: supranimbus
  password: 123456789
  timeout: 5000
  host: localhost
development:
  <<: *default
  database: rails-sample-guestbook-master_development

test:
  <<: *default
  database: rails-sample-guestbook-master_test

production:
  <<: *default
  database: rails-sample-guestbook-master_production
default:&default
适配器:postgresql
编码:unicode
游泳池:5
用户名:supranimbus
密码:123456789
超时:5000
主机:本地主机
发展:

我猜问题在于
postgresql
上的设置密码。如果您不记得默认密码,请转到pgAdmin单击打开仪表板,然后左侧边栏查看下图

单击属性…然后将打开一个模式,如下图所示

然后单击定义选项卡,查看密码字段并设置新密码,记住
postgres
用户名的密码

这是密码设置

现在更新您的
数据库.yml
文件,如下所示

default: &default
  adapter: postgresql
  encoding: unicode
  username: postgres
  password: 123456 #=> which you set for postgres
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
  <<: *default
  database: project_development
default:&default
适配器:postgresql
编码:unicode
用户名:postgres
密码:123456#=>您为postgres设置的密码
游泳池:
发展:

您可以在配置文件(
database.yml
)中检查密码设置,您的密码真的是
password
唯一的单词吗?请共享您的
数据库。yml
了解您是否正确配置了postgres数据库。您的数据库是如何配置的?rails应用程序是如何配置的?你没有和我们分享这些东西,所以不可能回答这个问题。。。但几乎可以肯定的是,问题在于这两种配置不匹配。默认值:&默认适配器:postgresql编码:unicode池:5用户名:SuperNimbus密码:123456789超时:5000主机:本地主机开发: