Forum: Ruby Postgresql could not connect to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
64bc95dd4f1257d4a061a35a38e6e26d?d=identicon&s=25 ngoc (Guest)
on 2006-03-06 15:40
(Received via mailing list)
Hi

My environment is Windows XP and have installed 'gem install
postgres-pr'.

Postgresql is running.

I have this code for test of connection

require 'dbi'
dbh = DBI.connect('DBI:Pg:my_db:localhost', 'my_account_name',
'my_passwd')
rows = dbh.execute('select * from customer')
row = rows.fetch
puts row[0]

The error message is

C:\>ruby db.rb
c:/program files/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:499:in
`load_driver':  is not a class/module (TypeError)
         from c:/program
files/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:in `_ge
t_full_driver'
         from c:/program
files/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in `connect'
         from db.rb:2
Thanks
ngoc
A402df36168b81b31c17adcbb5ae8cf4?d=identicon&s=25 Pistos Christou (pistos)
on 2006-03-07 19:17
ngoc wrote:
> C:\>ruby db.rb
> c:/program files/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:499:in
> `load_driver':  is not a class/module (TypeError)
>          from c:/program
> files/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:in `_ge
> t_full_driver'
>          from c:/program
> files/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in `connect'
>          from db.rb:2

See these bug tracker items:

http://rubyforge.org/tracker/index.php?func=detail...
http://rubyforge.org/tracker/index.php?func=detail...

You may have compiled DBI without Postgres support; or the driver is
missing; or... something else is missing.  :)

I encountered this problem recently on FreeBSD.  I never solved it.

HTH;
Pistos
This topic is locked and can not be replied to.