DBI-PG problems

  • Thread starter culley harrelson
  • Start date
C

culley harrelson

I am having trouble with DBI-Pg on os X (ruby 1.6.7). I installed it
successfully using config --with=dbi,dbd_pg but when I try to establish
a connection I get:

704 $ ./test.rb
/usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:502:in `load_driver': Could not
load driver (No such file to load -- postgres) (DBI::InterfaceError)
from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:392:in
`_get_full_driver'
from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:372:in `connect'
from ./test.rb:4

Any suggestions? Installation was quite clean on FreeBSD... no
problems there!

culley
 
M

Michael Garriss

I'm not sure but I don't think you would have made it through the
install process if libpg in not found. Try adding the postgres ruby
package...that has to be it.
 
C

culley harrelson

this worked. I had to upgrade ruby to 1.6.8-- OS X 10.2 comes with
1.6.7 and the postgres package wouldn't install ("can't find header
files for ruby." was thrown from mkmf.rb). Thanks!

culley
 
M

Michael Garriss

no problem....I spent an hour staring at that 'load_driver' error
message once. the docs don't make it very clear.
 
M

Michael Garriss

While installing DBI I got the error that it could not find the
postgreSQL libs. After pointing it to /usr/local/psql/lib and
/usr/local/psql/include it installed fine. I then had to install the
postgres RAA package in order to connect, before that I got the same
'load_driver' error that Culley was getting.
 
M

Michael Garriss

I just tried it again and as you probably suspected you are right. :)
It was while installing the ruby-postgres-0.7.1 package. Sorry for
posting bad info.

Brian said:
While installing DBI I got the error that it could not find the
postgreSQL libs. After pointing it to /usr/local/psql/lib and
/usr/local/psql/include it installed fine. I then had to install the
postgres RAA package in order to connect, before that I got the same
'load_driver' error that Culley was getting.

Strange, because that's not the same here. My machine has never been near
postgres but I can install its DBD quite happily:

[ruby-dbi-all]$ ruby setup.rb config --with=dbi,dbd_mysql,dbd_pg
entering config phase...
config done.
[ruby-dbi-all]$ ruby setup.rb setup
entering setup phase...
setting #! line to "#!/usr/local/bin/ruby"
setup.rb: skip bin/proxyserver(dbd_proxy) by user option
setup.rb: skip ext/dbd_sqlite(dbd_sqlite) by user option
setup.rb: skip ext/dbd_sybase(dbd_sybase) by user option
setup done.
[ruby-dbi-all]$ su
Password:
bloodhound# ruby setup.rb install
entering install phase...
mkdir -p /usr/local/bin
install sqlsh.rb /usr/local/bin
setup.rb: skip bin/proxyserver(dbd_proxy) by user option
setup.rb: skip lib/dbd_ado(dbd_ado) by user option
setup.rb: skip lib/dbd_db2(dbd_db2) by user option
setup.rb: skip lib/dbd_interbase(dbd_interbase) by user option
setup.rb: skip lib/dbd_msql(dbd_msql) by user option
mkdir -p /usr/local/lib/ruby/site_ruby/1.6/DBD/Mysql
install Mysql.rb /usr/local/lib/ruby/site_ruby/1.6/DBD/Mysql
setup.rb: skip lib/dbd_odbc(dbd_odbc) by user option
setup.rb: skip lib/dbd_oracle(dbd_oracle) by user option
mkdir -p /usr/local/lib/ruby/site_ruby/1.6/DBD/Pg
install Pg.rb /usr/local/lib/ruby/site_ruby/1.6/DBD/Pg
setup.rb: skip lib/dbd_proxy(dbd_proxy) by user option
setup.rb: skip lib/dbd_sqlrelay(dbd_sqlrelay) by user option
mkdir -p /usr/local/lib/ruby/site_ruby/1.6/dbi
install columninfo.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
install dbi.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
install row.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
install sql.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
install trace.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
install utils.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
install version.rb /usr/local/lib/ruby/site_ruby/1.6/dbi
mkdir -p /usr/local/lib/ruby/site_ruby/1.6/.
install dbi.rb /usr/local/lib/ruby/site_ruby/1.6/.
setup.rb: skip ext/dbd_sqlite(dbd_sqlite) by user option
setup.rb: skip ext/dbd_sybase(dbd_sybase) by user option
install done.

There are only two DBDs in ruby-dbi-all-0.0.19 which link to C libraries
(sybase and sqlite)

Regards,

Brian.
 

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,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top