Ruby - Native MySQL Gem vs. Pure Ruby Version

June 13, 2007

I recently discovered that while I had installed the native mysql gem for ruby that it wasn’t being used by my ruby (and rails) scripts. It turned out that even those the mysql.so was being generated correctly, it wasn’t being copied into the right location. In my case I needed to copy:

/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so

into:

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/mysql.so

Thanks to this post for info on how to check what mysql driver is being used.