I tried several ideas ... none of them worked ... I\'m just trying to install mysql2 as a gem. My mysql is working, but every time my system says, that mysql.h is missing .
Using a package manager like Homebrew or MacPorts makes it fairly straight-forward to fix this. The binary distribution of MySQL direct from Oracle and the one bundled with OS X itself does not have the development headers, of which mysql.h
is one of them.
Homebrew would fix it like this:
brew install mysql
MacPorts is very similar:
sudo port install mysql
Both of these install libraries, a command-line client and the associated development headers for the libraries. Enabling the server is optional.
As an alternative, you can get the source direct from Apple and install it whatever way you see fit.
Generally Homebrew is the best way to go.