bundle install problem: mysql.h is missing

I did a bundle install on a redmine repo and got the same error message :

mysql.h is missing. please check your installation of mysql and try again.

Running Fedora 16 64 bits, all I did was install mysql-devel (development package) from the distro rpm and the problem was solved!

So I think you could just

yum install mysql-devel

or apt-get the missing devel package.


I tried all the solutions posted here, but was not lucky. I reinstalled mysql with homebrew a couple of times and still no luck. Then I came across a blog post with a solution.

I edited the mysql_config file in /usr/local/Cellar/mysql/5.6.12/bin and removed the W-compiler options -Wno-null-conversion and -Wno-unused-private-field for cflags and cxxflags.

This solved the problem with gem install mysql2 and bundle install

Reference: http://www.randomactsofsentience.com/2013/05/gem-install-mysql2-missing-mysqlh-on-os.html