title: Rails Server causes error with Mysql2
body: <p>I am running Rails 3.2 and Ruby 2.0 on a Windows 7 machine. 
  I finally got Mysql2 installed (at least I thought so). I can run "bundle install" with no problem, and mysql2 v.0.3.16 shows up in my gem bundle.</p>
  
  <p>But when I run "gem install mysql2" it fails due to native extensions.
  Now I am trying to run "rails s" to start my server, and I am getting more errors.</p>
  
  <pre><code>Stealth@STEALTH-PC ~/Documents/GitHub/flitti (tony-dev)
  $ rails s
  DL is deprecated, please use Fiddle
  c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2.rb
  :8:in `require': cannot load such file -- mysql2/mysql2 (LoadError)
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/
  lib/mysql2.rb:8:in `&lt;top (required)&gt;'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler/runtime.rb:72:in `require'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler/runtime.rb:72:in `block (2 levels) in require'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler/runtime.rb:70:in `each'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler/runtime.rb:70:in `block in require'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler/runtime.rb:59:in `each'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler/runtime.rb:59:in `require'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
  lib/bundler.rb:132:in `require'
          from c:/Users/Stealth/Documents/GitHub/flitti/config/application.rb:7:in
   `&lt;top (required)&gt;'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
  2/lib/rails/commands.rb:53:in `require'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
  2/lib/rails/commands.rb:53:in `block in &lt;top (required)&gt;'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
  2/lib/rails/commands.rb:50:in `tap'
          from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
  2/lib/rails/commands.rb:50:in `&lt;top (required)&gt;'
          from script/rails:6:in `require'
          from script/rails:6:in `&lt;main&gt;'
  </code></pre>
  
  <p>My Gemfile looks like this</p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails', '3.2.12'
  gem 'foundation-rails'
  gem 'mysql2'
  gem 'merit'
  gem 'devise'
  gem 'paperclip', '3.4.0'
  gem 'pry'
  gem 'mailboxer'
  gem 'simple_form'
  gem 'thumbs_up'
  gem 'jquery-rails'
  
  gem 'faye'
  gem 'private_pub', :git =&gt; 'git://github.com/ryanb/private_pub.git'
  gem 'thin'
  gem 'pjax_rails'
  
  group :assets do
    gem 'sass-rails',   '~&gt; 3.2.3'
    gem 'coffee-rails', '~&gt; 3.2.1'
    gem 'uglifier', '&gt;= 1.0.3'
  end
  
  
  group :development, :test do
      gem 'rspec-rails'
      gem 'factory_girl_rails'
  end
  
  group :test do
      gem 'faker'
    gem "capybara"
    gem "guard-rspec"
    gem "launchy"
  end
  </code></pre>
  
  <p>How can I fix this so I can get my rails server working?</p>
  
  <p>Native Extensions Error:</p>
  
  <pre><code>Stealth@STEALTH-PC /c
  $ gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector-c
  "'
  Temporarily enhancing PATH to include DevKit...
  Building native extensions with: '--with-mysql-dir="C:\mysql-connector-c"'
  This could take a while...
  ERROR:  Error installing mysql2:
          ERROR: Failed to build gem native extension.
  
      c:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb --with-mysql-dir="C:\mys
  ql-connector-c"
  checking for ruby/thread.h... yes
  checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
  checking for rb_thread_blocking_region()... yes
  checking for rb_wait_for_single_fd()... yes
  checking for rb_hash_dup()... yes
  checking for rb_intern3()... yes
  -----
  Cannot find include dir(s) C:\mysql-connector-c/include
  -----
  *** 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=c:/RailsInstaller/Ruby2.0.0/bin/ruby
          --with-mysql-dir
          --with-mysql-include
          --without-mysql-include=${mysql-dir}/include
          --with-mysql-lib
          --without-mysql-lib=${mysql-dir}/
          --with-mysql-dir
          --with-mysql-include
          --without-mysql-include=${mysql-dir}/include
          --with-mysql-lib
          --without-mysql-lib=${mysql-dir}/lib
  
  
  Gem files will remain installed in c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0
  .0/gems/mysql2-0.3.16 for inspection.
  Results logged to c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/mysql2-0.
  3.16/ext/mysql2/gem_make.out
  </code></pre>