【问题标题】:rake aborted! PG::ConnectionBad: fe_sendauth: no password supplied sinatra耙中止! PG::ConnectionBad: fe_sendauth: 未提供密码 sinatra
【发布时间】:2015-12-17 16:27:08
【问题描述】:

我似乎无法让它工作。我在运行bundle exec rake db:create 后尝试运行bundle exec rake db:migrate,它给了我这个错误:

rake aborted! PG::ConnectionBad: fe_sendauth: no password supplied /home/david/DBC/survey-gorilla-challenge/Rakefile:106:in block (2 levels) in <top (required)>' Tasks: TOP => db:migrate (See full trace by running task with --trace)

我试过环顾四周,但这一切似乎都是 Rails 的解决方案,而我将它与 Sinatra 和 activerecord 一起使用。我不确定这是否有什么不同。我什至尝试更改我的pg_hba.conf,目前看起来像这样:

IPv4 local connections: host all all 127.0.0.1/32 md5 IPv6 local connections: host all all ::1/128 md5

我不知道如何让它工作。任何帮助表示赞赏。

【问题讨论】:

    标签: ruby postgresql sinatra sinatra-activerecord


    【解决方案1】:

    我解决了。我将我的pg_hba.conf 更改为

    TYPE  DATABASE        USER            ADDRESS                 METHOD
    
    "local" is for Unix domain socket connections only
    
    host   all             all          127.0.0.1/32               trust
     IPv4 local connections:
    host   all             PC           127.0.0.1/32               trust
     IPv6 local connections:
    host   all             all            ::1/128                  trust
    

    然后使用sudo nano /etc/postgresql/9.3/main/pg_hba.conf 重新启动 postgres。这样就可以进行迁移了。

    【讨论】:

    • 大声笑,你使用nano重新启动?
    • 哈哈...用sudo /etc/init.d/postgresql restart重启PostgreSQL
    猜你喜欢
    • 1970-01-01
    • 2014-06-16
    • 1970-01-01
    • 1970-01-01
    • 2019-04-25
    • 1970-01-01
    • 2019-07-23
    • 2016-10-15
    • 1970-01-01
    相关资源
    最近更新 更多