Problems using MySQL in Ruby...

  • Thread starter Just Another Victim of the Ambient Morality
  • Start date
J

Just Another Victim of the Ambient Morality

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

http://www.tmtm.org/en/mysql/ruby/

...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 (e-mail address removed)
Thank you!
 
R

Ross Bamford

...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 (e-mail address removed)
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,
 

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,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top