我正在尝试将Padrino与Sequel和Postgres一起使用,并且没有运气连接。
在我的pg_hba.conf中,我将postgres用户设置为'trust',因此不需要密码(并且可以使用没有密码的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
我在这里做错了什么?