Install mysql2 gem in Mac OS X with mysql installed via brew
I leave this here for future reference as this is the typical thing you'll forget instantly and need always. If you install MySQL on Mac OS X Mountain Lion via brew, it will install all mysql files here:
/usr/local/opt/mysql/
First of all you need to be sure that your tools are working properly, issue the following command (Brew will alert you on missed or broken compilers, libraries or whatever):
$ brew doctor
Your system is raring to brew.
Do anything brew says that you should do and then install your gem providing the actual mysql directory like this:
$ gem install mysql2 -- --with-mysql-dir=/usr/local/opt/mysql/
Happy coding!
Written by Javier Toledo
Related protips
3 Responses
Thank's for the reminder, I always rage so much when I have to install this gem on OSX...
over 1 year ago
·
Run bundle install
to install missing gems.
i tryed every thing
over 1 year ago
·
I didn't have this issue with mariadb on Mountain Lion.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#