[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Problems using MySQL in Ruby...

Just Another Victim of the Ambient Morality

1/14/2006 4:32:00 AM

I asked the administrator of my machine to install a MySQL API module
from the site:

http://www.tmtm.org/en/m...

...but it's not working. Running the simple script:


#!/usr/bin/ruby

require "mysql"

sql = Mysql.new("localhost", "me", "my_password", "my_database")


...causes the error:

/usr/bin/ruby: relocation error: /usr/lib/ruby/1.6/i386-linux-gnu/mysql.so:
undefined symbol: StringValuePtr

If I were to guess, this looks like a simple problem. The system uses
Ruby 1.6 (as you can see) and MySQL 3.23.58, which are both older versions
than the interface claims to support. However, I suspect that's not the
source of the error "undefined symbol: StringValuePtr".
Can anyone take a wild and crazy guess as to what the problem is? If
you prefer to e-mail me, you can reach me at spam_receptacle_@hotmail.com
Thank you!


1 Answer

Ross Bamford

1/14/2006 5:26:00 PM

0

On Sat, 14 Jan 2006 04:32:29 -0000, Just Another Victim of the Ambient
Morality <ihatespam@rogers.com> wrote:

> ...causes the error:
>
> /usr/bin/ruby: relocation error:
> /usr/lib/ruby/1.6/i386-linux-gnu/mysql.so:
> undefined symbol: StringValuePtr
>
> If I were to guess, this looks like a simple problem. The system
> uses
> Ruby 1.6 (as you can see) and MySQL 3.23.58, which are both older
> versions
> than the interface claims to support. However, I suspect that's not the
> source of the error "undefined symbol: StringValuePtr".
> Can anyone take a wild and crazy guess as to what the problem is? If
> you prefer to e-mail me, you can reach me at spam_receptacle_@hotmail.com
> Thank you!
>

AFAIK StringValuePtr is a C-side macro that's used (somewhat predictably)
to get a C pointer to a Ruby string's value. It was introduced in Ruby 1.8
(previously STR2CSTR was used but from what I gather this is quite a
different API).

So I would guess that it *is* down to the use of Ruby 1.6 with libraries
written for 1.8+.

Cheers,

--
Ross Bamford - rosco@roscopeco.remove.co.uk