title: MAMP + Rails MYSQL installation issue. Can't create a rails app
body: <p>I have had no luck getting a new rails app up and running while using MAMP on Yosemite.</p>
  
  <pre><code>user$ rails new testrailsapp -d mysql --with-mysqlconfig=/usr/local/Cellar/mysql/5.6.21/bin/mysql_config
         exist  
     identical  README.rdoc
     identical  Rakefile
     identical  config.ru
     identical  .gitignore
     identical  Gemfile
         exist  app
     identical  app/assets/javascripts/application.js
     identical  app/assets/stylesheets/application.css
     identical  app/controllers/application_controller.rb
     identical  app/helpers/application_helper.rb
     identical  app/views/layouts/application.html.erb
     identical  app/assets/images/.keep
     identical  app/mailers/.keep
     identical  app/models/.keep
     identical  app/controllers/concerns/.keep
     identical  app/models/concerns/.keep
         exist  bin
     identical  bin/bundle
     identical  bin/rails
     identical  bin/rake
         exist  config
     identical  config/routes.rb
     identical  config/application.rb
     identical  config/environment.rb
      conflict  config/secrets.yml
  Overwrite /Users/user/testrailsapp/config/secrets.yml? (enter "h" for help) [Ynaqdh] a
         force  config/secrets.yml
         exist  config/environments
     identical  config/environments/development.rb
     identical  config/environments/production.rb
     identical  config/environments/test.rb
         exist  config/initializers
     identical  config/initializers/assets.rb
     identical  config/initializers/backtrace_silencers.rb
     identical  config/initializers/cookies_serializer.rb
     identical  config/initializers/filter_parameter_logging.rb
     identical  config/initializers/inflections.rb
     identical  config/initializers/mime_types.rb
     identical  config/initializers/session_store.rb
     identical  config/initializers/wrap_parameters.rb
         exist  config/locales
     identical  config/locales/en.yml
     identical  config/boot.rb
     identical  config/database.yml
         exist  db
     identical  db/seeds.rb
         exist  lib
         exist  lib/tasks
     identical  lib/tasks/.keep
         exist  lib/assets
     identical  lib/assets/.keep
         exist  log
     identical  log/.keep
         exist  public
     identical  public/404.html
     identical  public/422.html
     identical  public/500.html
     identical  public/favicon.ico
     identical  public/robots.txt
         exist  test/fixtures
     identical  test/fixtures/.keep
         exist  test/controllers
     identical  test/controllers/.keep
         exist  test/mailers
     identical  test/mailers/.keep
         exist  test/models
     identical  test/models/.keep
         exist  test/helpers
     identical  test/helpers/.keep
         exist  test/integration
     identical  test/integration/.keep
     identical  test/test_helper.rb
         exist  tmp/cache
         exist  tmp/cache/assets
         exist  vendor/assets/javascripts
     identical  vendor/assets/javascripts/.keep
         exist  vendor/assets/stylesheets
     identical  vendor/assets/stylesheets/.keep
           run  bundle install
  Fetching gem metadata from https://rubygems.org/...........
  Resolving dependencies...
  Using rake 10.3.2
  Using i18n 0.6.11
  Using json 1.8.1
  Using minitest 5.4.2
  Using thread_safe 0.3.4
  Using tzinfo 1.2.2
  Using activesupport 4.1.7
  Using builder 3.2.2
  Using erubis 2.7.0
  Using actionview 4.1.7
  Using rack 1.5.2
  Using rack-test 0.6.2
  Using actionpack 4.1.7
  Using mime-types 2.4.3
  Using mail 2.6.1
  Using actionmailer 4.1.7
  Using activemodel 4.1.7
  Using arel 5.0.1.20140414130214
  Using activerecord 4.1.7
  Using bundler 1.7.4
  Using coffee-script-source 1.8.0
  Using execjs 2.2.2
  Using coffee-script 2.3.0
  Using thor 0.19.1
  Using railties 4.1.7
  Using coffee-rails 4.0.1
  Using hike 1.2.3
  Using multi_json 1.10.1
  Using jbuilder 2.2.4
  Using jquery-rails 3.1.2
  
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  
      /Users/user/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20141101-36276-1x98hhg.rb extconf.rb 
  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
  -----
  Using mysql_config at /Applications/MAMP/Library/bin/mysql_config
  -----
  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/user/.rvm/rubies/ruby-2.1.4/bin/ruby
      --with-mysql-dir
      --without-mysql-dir
      --with-mysql-include
      --without-mysql-include=${mysql-dir}/include
      --with-mysql-lib
      --without-mysql-lib=${mysql-dir}/lib
      --with-mysql-config
      --without-mysql-config
  
  extconf failed, exit code 1
  
  Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.1.4/gems/mysql2-0.3.16 for inspection.
  Results logged to /Users/user/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-14/2.1.0/mysql2-0.3.16/gem_make.out
  An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.
  Make sure that `gem install mysql2 -v '0.3.16'` succeeds before bundling.
           run  bundle exec spring binstub --all
  bundler: command not found: spring
  Install missing gem executables with `bundle install`
  </code></pre>
  
  <p>.</p>
  
  <p>.When I attempt to run the mysql2 install, I get this:</p>
  
  <pre><code>users-MacBook-Pro:~ user$ gem install mysql2 -v '0.3.16'
  Building native extensions.  This could take a while...
  ERROR:  Error installing mysql2:
      ERROR: Failed to build gem native extension.
  
      /Users/user/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20141101-37298-dtpq0m.rb extconf.rb
  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
  -----
  Using mysql_config at /Applications/MAMP/Library/bin/mysql_config
  -----
  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/user/.rvm/rubies/ruby-2.1.4/bin/ruby
      --with-mysql-dir
      --without-mysql-dir
      --with-mysql-include
      --without-mysql-include=${mysql-dir}/include
      --with-mysql-lib
      --without-mysql-lib=${mysql-dir}/lib
      --with-mysql-config
      --without-mysql-config
  
  extconf failed, exit code 1
  
  Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.1.4/gems/mysql2-0.3.16 for inspection.
  Results logged to /Users/user/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-14/2.1.0/mysql2-0.3.16/gem_make.out
  </code></pre>
  
  <p>.</p>
  
  <p>.my /etc/paths looks like this:</p>
  
  <pre><code>/Applications/MAMP/Library/bin
  /usr/local/bin
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  </code></pre>
  
  <p>.
  .
  .
  mysql status
  UNIX socket:        /Applications/MAMP/tmp/mysql/mysql.sock</p>
  
  <p>.
  .
  .
  I also tried:</p>
  
  <pre><code>rails new testrailsapp -d mysql –-with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
  </code></pre>
  
  <p>.
  Any help would be appreciated!</p>