Home > tips > MySQL gem doesn’t work after upgrading Ubuntu

MySQL gem doesn’t work after upgrading Ubuntu

I upgraded Ubuntu 9.10 to 10.04. Everything was cool. I tried to work on a Rails project I am involved by issuing the command rake db:migrate to update the database.

I was getting the following error:

Error: uninitialized constant MysqlCompat::MysqlRes

Then I uninstalled the mysql gem and tried to install it again only to get the following error:

Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

Then I issued the following command:

sudo apt-get install libmysqlclient-dev

and then installed mysql gem and it installed with no problems. Finally, rake db:migrate worked again.

Categories: tips Tags: , , , , ,
  1. No comments yet.
  1. No trackbacks yet.