Topic: Mysql rubygem errors
Hey all, I'm trying to get the Mysql rubygem installed on a Linux system and running into some issues. Hopefully this is an appropriate forum to post such a dilemma.
I have a Fedora 2 system with mysql 3.23.58 (installed via yum). Downloaded and installed Ruby 1.8.4 and rubygems 0.9.0. Then what seems to be a successful installation of the mysql 2.7 rubygem. I installed it with the following command:
$ gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
mysql_config has the following output:
--libs [-L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm]
The install goes smoothly, however I get no love when trying to use the gem in a script. The test script that comes with the mysql gem produces the following output:
$ ruby ./test.rb someuser somepass somedb
./mysql.so: ./mysql.so: undefined symbol: __pure_virtual - ./mysql.so (LoadError)
If I try to use it in a script like the following:
$ cat test_connection.rb
@dbh = Mysql.real_connect(host, user, pass, db)
rescue MysqlError => e
print "Error found man!"
I get the following when I run it:
./test_connection.rb:15: uninitialized constant Mysql (NameError)
I'm thinking there is a good chance this is a newbie error but I can't seem to figure it out (probably since I'm a newbie ). Any help is greatly appreciated.