Ruby DBI problem

O

Orion Hunter

I'm trying to get MySQL to work with Ruby 1.8.

I've d/l and installed the DBI (from RAA). I installed as follows:

$>ruby setup.rb config --with=dbi,dbd_mysql,dbd_msql
setup.rb:586: warning: parenthesize argument(s) for future version
entering config phase...
config done.

$>ruby setup.rb setup
setup.rb:586: warning: parenthesize argument(s) for future version
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 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
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/DBD/Msql
install Msql.rb /usr/local/lib/ruby/site_ruby/1.8/DBD/Msql
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql
install Mysql.rb /usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql
setup.rb: skip lib/dbd_odbc(dbd_odbc) by user option
setup.rb: skip lib/dbd_oracle(dbd_oracle) by user option
setup.rb: skip lib/dbd_pg(dbd_pg) by user option
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.8/dbi
install columninfo.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
install dbi.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
install row.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
install sql.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
install trace.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
install utils.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
install version.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/.
install dbi.rb /usr/local/lib/ruby/site_ruby/1.8/.
setup.rb: skip ext/dbd_sqlite(dbd_sqlite) by user option
setup.rb: skip ext/dbd_sybase(dbd_sybase) by user option
install done.


However, when I type the following in at the command line: (with approriate
username, pass, dbname, etc, and yes, the DB I try to use exists and this
user has access)

$> ruby -e 'require "dbi"; dbh = DBI.connect("DBI:MySQL:mydb", "username",
"mypass")'

I get the following error:

/usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:502:in `load_driver': Could not
load driver (No such file to load -- mysql) (DBI::InterfaceError)
from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:392:in
`_get_full_driver'
from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:372:in `connect'
from -e:1

So, instead of specifying the config --with option, I did default (all)

$>ruby setup.rb config
(same output as before)

$>ruby setup.rb setup (** NOTE this output is different,and gives errors)
entering setup phase...
setting #! line to "#!/usr/local/bin/ruby"
setting #! line to "#!/usr/local/bin/ruby"
/usr/local/bin/ruby extconf.rb
checking for sqlite_open() in -lsqlite... no
make
make: *** No targets specified and no makefile found. Stop.
setup failed
'system make' failed
try "ruby setup.rb --help" for usage

I go ahead and try to install anyway...

$>ruby setup.rb install
(same output as above, but instead of skips, it installs all. NOTE -- on
errors here, even with the above errors in the setup.rb setup)

Then, I go ahead and try my above "test", with the same errors.

What am I doing wrong here?

_________________________________________________________________
Compare high-speed Internet plans, starting at $26.95.
https://broadband.msn.com (Prices may vary by service area.)
 

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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top