---
title: Rake db:migrate MySQL gem dependency
url: https://www.grahambrooks.com/post/2011-01-24-rake-dbmigrate-mysql-gem-dependency/
date: 2011-01-24T00:00:00+00:00
author: Graham Brooks
tags:
- Database
- ruby
- Continuous Delivery
---

# Rake db:migrate MySQL gem dependency

If you have already added <code lang='ruby'>gem 'mysql2'</code> to
your Gemfile but get a message saying that it is missing when you try
to migrate

Make sure that you have installed libmysql-ruby

	sudo apt-get install libmysql-ruby

This one caught me out on the weekend and it took a while to work out
what was going on. I am guessing that not having libmysql-ruby
installed caused the gem to incorrectly advertise that it was not
available. I did not get any errors when installing the mysql2 gem
which is strange.
