Troubleshooting : gem install mysql on Ubuntu

Whilst deploying a VirtualBox of Ubuntu to act as a Ruby on Rails development server I hit several issues. One of which was installing the mysql gem with the command

sudo gem install mysql

Giving me the error of

With some googling I found the solution at mentalized.net needing to install ruby1.8-dev as it was missing in my case. To solve enter the following command…

sudo apt-get install ruby1.8-dev

That solved one problem but I hit another trying to install the mysql gem.

This one took more googling but eventually found codeweblog giving a solution. Again I was missing further dependent libraries in this case libmysqlclient15-dev. To install that enter the command…

sudo apt-get install libmysqlclient15-dev

Installing the mysql gem should now work.

Hope this helps.

  1. Kedar Mhaswade says:

    It does! Thank you a bunch.

  1. There are no trackbacks for this post yet.

Leave a Reply