title: gem install mysql fail
body: <p>I've followed the instructions on <a href="http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/" rel="noreferrer">http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/</a> , including the installation of ruby via macport.</p>
  
  <p>Whenever I execute <strong><em>gem install mysql</em></strong>  , I'll get the following error</p>
  
  <pre><code>bash-3.2# gem install mysql
  Building native extensions.  This could take a while...
  ERROR:  Error installing mysql:
      ERROR: Failed to build gem native extension.
  
          /opt/local/bin/ruby extconf.rb
  checking for mysql_ssl_set()... no
  checking for rb_str_set_len()... no
  checking for rb_thread_start_timer()... no
  checking for mysql.h... no
  checking for mysql/mysql.h... no
  *** 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=/opt/local/bin/ruby
      --with-mysql-config
      --without-mysql-config
  
  
  Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
  Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
  </code></pre>
  
  <p>How can I resolve this issue ? I've installed the 32-bit mysql using the package file (.pkg) and also, I'm extremely new to ruby... </p>
  
  <p><strong><em>Update 4/26/11 5:11pm EST</em></strong>
  Installed RVM and updated ruby to 1.9.2
  Also I have looked through the links posted on the comments.  I did <code>locate mysql_config</code>
  and results were</p>
  
  <pre><code>/usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config
  /usr/local/mysql-5.1.56-osx10.6-x86/man/man1/mysql_config.1
  </code></pre>
  
  <p>Hence, I tried 
  <code>gem install mysql - -with-mysql-config=/usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config</code>
  but it still doesn't work... I did get new error information however..</p>
  
  <pre><code>/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
  You have to install development tools first.
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
      from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
      from extconf.rb:50:in `&lt;main&gt;'
  
  
  Gem files will remain installed in /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/bin/th-mysql-config=/usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config/gems/mysql-2.8.1 for inspection.
  </code></pre>
  
  <p>Really wish to thank those who commented... and really appreciate if more help can be given..... been trying to get the darn mysql installed for 2 days... </p>