Wednesday, February 26, 2014

Install ruby's mysql gem on Windows 7

I have mysql database on my computer. I would like to use Ruby to access it.

First step is to install mysql gem. Run this at command prompt:
gem install mysql

Next step is to download the libmysql.dll
Here's the link to download the dll
http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
Extract the downloaded file, and go to the 'lib' directory and copy 'libmysql.dll'.

Now go to your ruby installation folder, open the "bin" folder, then paste the "libmysql.dll".

That's all.

How to test it? Create a ruby file, and type
require 'mysql'

Then run it. You won't see any error if the installation was successful.

1 comment:

sourabh nagori said...
This comment has been removed by a blog administrator.