title: mysql2 gem fails to compile with MySQL 5.6.12 on OS X with Homebrew
body: <p>I updated all the packages I installed with Homebrew. MySQL got upgraded to 5.6.12 (from 5.5.27 or so):</p>
  
  <pre><code>$ mysql --version
  mysql  Ver 14.14 Distrib 5.6.12, for osx10.8 (x86_64) using  EditLine wrapper
  </code></pre>
  
  <p>and now the mysql2 gem doesn't compile anymore:</p>
  
  <pre><code>$ gem install mysql2
  Building native extensions.  This could take a while...
  ERROR:  Error installing mysql2:
      ERROR: Failed to build gem native extension.
  
          /Users/pupeno/.rvm/rubies/ruby-1.9.3-p429-perf/bin/ruby extconf.rb
  checking for rb_thread_blocking_region()... yes
  checking for rb_wait_for_single_fd()... 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.
  -----
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.
  
  Provided configuration options:
      --with-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/Users/pupeno/.rvm/rubies/ruby-1.9.3-p429-perf/bin/ruby
      --with-mysql-config
      --without-mysql-config
  </code></pre>
  
  <p>The file <code>mysql.h</code> is present in <code>/usr/local/Cellar/mysql/5.6.12/include/mysql.h</code>. Any ideas what's going on?</p>
  
  <p>The file <code>mysql.h</code> doesn't appear in <code>/usr/local</code> because the symlink seems to go deeper than it should:</p>
  
  <pre><code>$ ls -la /usr/local/include/mysql
  lrwxr-xr-x  1 pupeno  admin  36 21 Jun 15:18 /usr/local/include/mysql@ -&gt; ../Cellar/mysql/5.6.12/include/mysql
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>/usr/local/Cellar/mysql/5.6.12/include
  </code></pre>
  
  <p>Having said that, I manually fixed the symlink and the compilation still failed. So I'm stuck.</p>