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!
You need to install the postgres package from RAA first. DBI sits on
top of it.
culley harrelson wrote:
···
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!
I had problems like this after installing DBD-Pg on Linux & on Cygwin
when the library files for Postgres itself weren’t getting found in
LD_LIBRARY_PATH. Make sure that the system can find its way to
/usr/local/postgres/lib (or whatever - it should have files such as
libpq.so in it). Tweak /etc/ld.so.conf (or the equivalent on OS X -
sorry, I’m not familiar with how library paths work on that) or
LD_LIBRARY_PATH, as you need.
HTH
alex
culley harrelson wrote:
···
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
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.
alex fenton wrote:
···
I had problems like this after installing DBD-Pg on Linux & on Cygwin
when the library files for Postgres itself weren’t getting found in
LD_LIBRARY_PATH. Make sure that the system can find its way to
/usr/local/postgres/lib (or whatever - it should have files such as
libpq.so in it). Tweak /etc/ld.so.conf (or the equivalent on OS X -
sorry, I’m not familiar with how library paths work on that) or
LD_LIBRARY_PATH, as you need.
HTH
alex
culley harrelson wrote:
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
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
Michael Garriss wrote:
···
You need to install the postgres package from RAA first. DBI sits on
top of it.
no problem…I spent an hour staring at that ‘load_driver’ error
message once. the docs don’t make it very clear.
culley harrelson wrote:
···
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
Michael Garriss wrote:
You need to install the postgres package from RAA first. DBI sits on
top of it.
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.
The DBI package is pure ruby and doesn’t depend on any C libraries, so it
installs quite happily. But when you actually try to do
DBI::connect(‘dbi:mysql:’) # for example then it will try to instantiate the ruby-mysql package, which is a wrapper
around the mysql C API. If you haven’t installed ruby-mysql, then it will
fail.
Regards,
Brian.
···
On Fri, Aug 01, 2003 at 10:07:17AM +0900, Michael Garriss wrote:
alex fenton wrote:
I had problems like this after installing DBD-Pg on Linux & on Cygwin
when the library files for Postgres itself weren’t getting found in
LD_LIBRARY_PATH. Make sure that the system can find its way to
/usr/local/postgres/lib (or whatever - it should have files such as
libpq.so in it). Tweak /etc/ld.so.conf (or the equivalent on OS X -
sorry, I’m not familiar with how library paths work on that) or
LD_LIBRARY_PATH, as you need.
HTH
alex
culley harrelson wrote:
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
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.
Brian Candler wrote:
···
On Fri, Aug 01, 2003 at 10:07:17AM +0900, Michael Garriss wrote:
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.
The DBI package is pure ruby and doesn’t depend on any C libraries, so it
installs quite happily. But when you actually try to do
DBI::connect(‘dbi:mysql:’) # for example then it will try to instantiate the ruby-mysql package, which is a wrapper
around the mysql C API. If you haven’t installed ruby-mysql, then it will
fail.
Regards,
Brian.
alex fenton wrote:
I had problems like this after installing DBD-Pg on Linux & on Cygwin
when the library files for Postgres itself weren’t getting found in
LD_LIBRARY_PATH. Make sure that the system can find its way to
/usr/local/postgres/lib (or whatever - it should have files such as
libpq.so in it). Tweak /etc/ld.so.conf (or the equivalent on OS X -
sorry, I’m not familiar with how library paths work on that) or
LD_LIBRARY_PATH, as you need.
HTH
alex
culley harrelson wrote:
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
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.
···
On Sat, Aug 02, 2003 at 12:47:50AM +0900, Michael Garriss wrote:
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.
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 Candler wrote:
···
On Sat, Aug 02, 2003 at 12:47:50AM +0900, Michael Garriss wrote:
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)