加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Ruby on Rails – 使用md5的Postgresql – Rak

发布时间:2020-12-17 02:14:07 所属栏目:百科 来源:网络整理
导读:我在Ubuntu上使用Rails设置 Postgresql,我收到错误:Rake Aborted! fe_sendauth:运行rake命令时没有提供密码. 我在database.yml文件中有以下内容: development: adapter: postgresql encoding: unicode database: test_database pool: 5 username: postgr
我在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,因为我想使用思考sphinx并且它不支持信任.

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

我错过了什么吗?

[编辑]
结果我无法拼写.我在我的database.yml中将’Passsword’更改为’Password’,现在可以正常工作了……

解决方法

修复拼写错误,想要在ubuntu的rails中使用用户/密码验证时,必须将postgresql安装目录的pg_hba.conf中的方法访问类型更改为md5

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读