title: Errors Installing mysql2 gem via the Bundler
body: <p>I am trying to install the <code>mysql2</code> gem via the Bundler, but it keeps dying with the following error:</p>
  
  <pre><code>** executing command
  /home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in 'rescue in block in build_extensions': 
  ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
  
  /home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config
  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.
  -----
  
  *** 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
  --without-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=/home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
  --with-mysql-config
  Gem files will remain installed for inspection.
  </code></pre>
  
  <p>Most things I found via Googling recommended passing the <code>--with-mysql-config</code> parameter to fix it.  So, based on:</p>
  
  <pre><code>$ which mysql_config
  /usr/bin/mysql_config
  </code></pre>
  
  <p>I added the following to the Bundler's config:</p>
  
  <pre><code>$ bundle config build.mysql2 --with-mysql-config='/usr/bin/mysql_config'
  </code></pre>
  
  <p>However, still no luck -- same crash as above.</p>
  
  <p>Since it's dying with the error <code>mysql.h is missing</code>, I checked for that, and it's allegedly around, just can't be found by the Bundler.</p>
  
  <pre><code>$ find / -name mysql.h
  /usr/include/mysql5/mysql/mysql.h
  </code></pre>
  
  <p>Any thoughts?</p>