Ruby, dbi and PostgreSQL

Dirk Meyer dirk.meyer at dinoex.sub.org
Mon Nov 16 15:20:56 UTC 2009


Hallo Penty Wenngren,

> Thanks Dirk, it seems your patches solved that problem. However, now I get
> another error message instead:
> 
> $ irb
> irb(main):001:0> require 'rubygems'
> => true
> irb(main):002:0> require 'dbi'
> => true
> irb(main):003:0> dbh = DBI.connect("DBI:Pg:mydb","user","secret")
> DBI::OperationalError: can't format
>         from /usr/local/lib/ruby/site_ruby/1.8/dbd/pg/database.rb:82:in
> `initialize'
>         from /usr/local/lib/ruby/site_ruby/1.8/dbd/Pg.rb:157:in `new'
>         from /usr/local/lib/ruby/site_ruby/1.8/dbd/Pg.rb:157:in `connect'
>         from /usr/local/lib/ruby/site_ruby/1.8/dbi/handles/driver.rb:33:in
> `connect'
>         from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:148:in `connect'
>         from (irb):3
 
The short name never worked for me even before the update.
Do you have a setup where it worked this way?

I used for some years this form and I tested it:
dbh = DBI.connect("DBI:Pg:dbname=mydb","user","secret")

kind regards Dirk

- Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
- [dirk.meyer at dinoex.sub.org],[dirk.meyer at guug.de],[dinoex at FreeBSD.org]
http://people.freebsd.org/~dinoex/errorlogs/


More information about the freebsd-ruby mailing list