无法通过续集连接到Postgres

问题描述 投票:3回答:1

我正在尝试将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

我在这里做错了什么?

ruby postgresql sequel padrino
1个回答
2
投票
可以找到该解决方案here
© www.soinside.com 2019 - 2024. All rights reserved.