我正在尝试将 Padrino 与 Sequel 和 Postgres 一起使用,但我没有运气连接。
在我的 pg_hba.conf 中,我将 postgres 用户设置为“信任”,因此不需要密码(并且可以在没有密码的情况下使用 PgAdmin 登录)。
# TYPE DATABASE USER ADDRESS METHOD
local all postgres trust
我的 Padrino 连接如下所示:
Sequel::Model.plugin(:schema)
Sequel::Model.raise_on_save_failure = false # Do not throw exceptions on failure
Sequel::Model.db = case Padrino.env
when :development then Sequel.connect(:adapter=>'postgres', :host=>'localhost', :database=>'padrino_template_development', :user=>'postgres', :password=>'', :loggers => [logger])
when :production then Sequel.connect("postgres://localhost/padrino_template_production", :loggers => [logger])
when :test then Sequel.connect("postgres://localhost/padrino_template_test", :loggers => [logger])
end
然后当我尝试运行 rake 任务时sq:create
我收到这条消息
rake sq:create
=> Creating database 'padrino_template_development'
Password:
createdb: could not connect to database postgres: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"
<= sq:create executed
我在这里做错了什么?