If you’re seeing the following error:
checking for rb_thread_blocking_region()... yes checking for mysql.h... no checking for mysql/mysql.h... no ----- mysql.h is missing. please check your installation of mysql and try again.
The way I was able to resolve it was to follow Boonedocks.net, since I’m also using MAMP for its MySQL Database instance.
The only difference is that I already had MAMP 1.9.4 installed and so I had to download the MAMP_components_1.9.dmg which contains the mysql-5.1.44 source code. MAMP 1.9.4 comes with mysql-5.1.44 but I needed the source code so I can compile libraries so the mysql Gem can link against it.
Here are the steps, assuming you already have MAMP or a separate standalone MySQL instance installed.
However, you should be able to follow similar instructions even if you don’t have MAMP installed. If you don’t have MAMP installed, correct the paths referenced below, as these ones below reference the MAMP directory.
- Figure out which version of mysql you have installed by running mysql from the prompt or checking your phpinfo page
- Download and Install the MAMP_components_1.x.dmg or the MySQL source code. The version should match your current mysql version though in order to avoid issues. Inside the MAMP Components, you should see a mysql tarball. You need to untar/unzip that.
- cd into the mysql-5.x source directory
- Assuming you have MAMP installed, type the following: ./configure –with-unix-socket-path=/Applications/MAMP/tmp/mysql/mysql.sock –without-server –prefix=/Applications/MAMP/Library
- Execute: make -j2
- Execute: cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql
- Execute: mkdir /Applications/MAMP/Library/include
- Execute: cp -R include /Applications/MAMP/Library/include/mysql
- Execute: sudo env ARCHFLAGS=”-arch i386″ gem install mysql — –with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
Leave a Reply