Wednesday, April 15, 2009

Mysql Gem On Linux

Installing mysql gem on linux turned out to be herculean task. I thought it would be easy as the way rails gem gets installed without any hassles.

Piece of cake gem install mysql.
But this gave out error complaining about some libraries and headers missing.

I am not an expert on linux but found difficult to provide right libraries and finding them all. I downloaded the source code of mysql had it configured and then make.

I had source in /home/leo/work/mysql-5.0.77

After make I gave the gem command as :

gem install mysql -- --with-mysql-lib=/home/leo/work/mysql-5.0.77/libmysql/.libs/ --with-mysql-include=/home/leo/work/mysql-5.0.77/include/

Voila no errors and it worked like a charm.

I have opensuse 10.3 and mysql I selected while installing it.

Was tricky for rails developer like me trying things on linux, mostly did work on M$.





No comments:

Post a Comment