Postgresql could not connect to

N

ngoc

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top