On Saturday, November 9, 2013 12:33:16 AM UTC-8, Lee Brooks wrote:

> I am trying to use the rake tasks to create and migrate my Padrino project 
> but am having no luck connecting to Postgres.
>
> In my database.rb file I have the following:
>
> 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
>
> My pg_hba.conf containts the following line at the top (and I can log in 
> using PgAdmin without giving a password)
> local all postgres trust
>

This pg_hba.conf setting only affects the unix socket connection I believe. 
 The Sequel connection strings you are using connect to the TCP socket on 
localhost, not the unix socket.  To use the unix socket, you probably want 
to leave the host part of the URL empty:

postgres:///padrino_template_test

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to