I usually use MAMP to add mysql to my local machine. I am using MAMP because I can use phpmyadmin to see my databases. I love simple things, that’s why I use it straight ahead.

Working with Ruby code a lot, that’s what I do for almost 4 years. But, when I should add mysql gem to my machine. There’s always a problem. It could not be installed because the gem installation expects the mysql installed on default path. I need to include mysql config that is placed within MAMP application. Here’s what I did.

gem install mysql2 -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config

I added with-mysql-config when installing the gem. Mysql gem will be installed successfully. I don’t need to add mysql separately on my machine to make it work.