【问题标题】:Ruby on Rails - Postgresql using md5 - Rake aborted! fe_sendauth: no password suppliedRuby on Rails - 使用 md5 的 Postgresql - Rake 中止! fe_sendauth:未提供密码
【发布时间】:2012-09-08 22:57:16
【问题描述】:

我在 Ubuntu 上使用 Rails 设置 Postgresql,但出现错误:Rake Aborted! fe_sendauth: 运行 rake 命令时没有提供密码。

我的 database.yml 文件中有以下内容:

development:
    adapter: postgresql
    encoding: unicode
    database: test_database
    pool: 5
    username: postgres
    passsword: <password> 

我更改了 pg_hba.conf 文件中的连接方法并重新启动了 postgresql 服务器,但出现了同样的错误。

# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   all             all                                     md5
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

我知道我可以将方法更改为信任并运行 rake 命令,但我需要使用 md5,因为我想使用 Thinking sphinx,它不支持信任。

我可以通过 pgAdmin 和在控制台中使用我的用户名和密码连接到数据库:psql -U postgres -d test_database。

我错过了什么吗?

[编辑] 原来我不会拼写。我在我的 database.yml 中将 'Password' 更改为 'Password' 并且它现在可以工作了......

【问题讨论】:

    标签: ruby-on-rails postgresql ubuntu passwords rake


    【解决方案1】:

    修正了错字,当你想在 ubuntu 上的 rails 中使用用户/密码认证时,你必须将你的 postgresql 安装目录的 pg_hba.conf 中的方法访问类型更改为 md5

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-25
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-02
      相关资源
      最近更新 更多