[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Unable to load mysql driver (Ubuntu 8.04

Chris Williams

8/17/2008 5:10:00 AM

Hi,

When I try to run a script that requires "dbi" I get the following
error:

/usr/local/lib/ruby/site_ruby/1.8/dbi.rb:352:in `load_driver': Unable to
load driver 'Mysql' (DBI::InterfaceError)
from /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:282:in `load_driver'
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:233:in
`_get_full_driver'
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:219:in `connect'

The Mysql server is working fine and my Rails apps can even access it.

The script itself has previously worked on other installations.

I do have gem mysql-2.7 installed.

ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]


Any help tracking the source of this problem down would be greatly
appreciated.
--
Posted via http://www.ruby-....

5 Answers

David Masover

8/17/2008 5:45:00 AM

0

On Sunday 17 August 2008 00:09:54 Chris Williams wrote:

> /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:352:in `load_driver': Unable to
> load driver 'Mysql' (DBI::InterfaceError)
[...]
> The Mysql server is working fine and my Rails apps can even access it.

That doesn't mean there's Ruby support for MySQL installed.

I would guess that you need to install the mysql gem, and possibly more
DBI-specific bindings for it.

Chris Williams

8/17/2008 5:28:00 PM

0

David Masover wrote:

>
> That doesn't mean there's Ruby support for MySQL installed.
>
> I would guess that you need to install the mysql gem, and possibly more
> DBI-specific bindings for it.

Thanks for the reply, but as I said I did install the mysql gem already.
I've uninstalled and reinstalled it multiple times both using gem and
from source.

I also have installed libdbd-mysql-ruby1.8 from the repository. Also the
mysql dev library is installed.

Ruby was installed from source instead of apt if that makes a
difference.
--
Posted via http://www.ruby-....

David Masover

8/17/2008 5:36:00 PM

0

On Sunday 17 August 2008 12:27:42 Chris Williams wrote:

> Thanks for the reply, but as I said I did install the mysql gem already.
> I've uninstalled and reinstalled it multiple times both using gem and
> from source.

Ah, sorry. Do you have rubygems require'd?

That's all I've got...

Chris Williams

8/17/2008 7:41:00 PM

0

David Masover wrote:
> On Sunday 17 August 2008 12:27:42 Chris Williams wrote:
>
>> Thanks for the reply, but as I said I did install the mysql gem already.
>> I've uninstalled and reinstalled it multiple times both using gem and
>> from source.
>
> Ah, sorry. Do you have rubygems require'd?
>
> That's all I've got...

Unfortunately that didn't work either. I finally had to uninstall Ruby
and install the older version in the repository with apt.

--
Posted via http://www.ruby-....

Martin Boese

9/4/2008 8:51:00 PM

0

Just ran into same problem, here is the fix:

require 'rubygems'
gem 'dbi'
require 'dbi' # => Now the gems version gets loaded.

There is another dbi.rb that acts different than the one from gems:

/usr/lib/ruby/1.8/dbi.rb vs. /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb


On Sunday 17 August 2008 05:09:54 Chris Williams wrote:
> Hi,
>
> When I try to run a script that requires "dbi" I get the following
> error:
>
> /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:352:in `load_driver': Unable to
> load driver 'Mysql' (DBI::InterfaceError)
> from /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:282:in `load_driver'
> from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:233:in
> `_get_full_driver'
> from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:219:in `connect'
>
> The Mysql server is working fine and my Rails apps can even access it.
>
> The script itself has previously worked on other installations.
>
> I do have gem mysql-2.7 installed.
>
> ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
>
>
> Any help tracking the source of this problem down would be greatly
> appreciated.