<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Patrick Tulskie &#187; ruby gem mysql rails</title>
	<atom:link href="http://www.patricktulskie.com/tag/ruby-gem-mysql-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.patricktulskie.com</link>
	<description>Building a Better Internet</description>
	<lastBuildDate>Wed, 16 Jun 2010 19:12:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Leopard and MySQL Gem</title>
		<link>http://www.patricktulskie.com/2008/11/leopard-and-mysql-gem/</link>
		<comments>http://www.patricktulskie.com/2008/11/leopard-and-mysql-gem/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 18:48:14 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[leopard mysql gem]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby gem mysql rails]]></category>

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=88</guid>
		<description><![CDATA[Explains how to get the MySQL ruby gem to compile for Macs on OS X Leopard.]]></description>
			<content:encoded><![CDATA[<p>Those of you doing rails development work on Leopard with MySQL have probably seen this error message when starting your app:</p>
<blockquote><p>WARNING: You&#8217;re using the Ruby-based MySQL library that ships with Rails. This library is not suited for production. Please install the C-based MySQL library instead (gem install mysql).</p></blockquote>
<p>Normally I don&#8217;t care, but I figured since I was doing some cleanup today and getting things ready to move on to a longer term it might be good to have a properly working MySQL gem.  I like to run with a system that is close to what we run production.  The closer you get, the less surprises you have when you push it live.</p>
<p><span id="more-88"></span></p>
<p><strong>More Fixing.  Less Talking.</strong></p>
<p>Damn you&#8217;re so pushy sometimes.  Anyhow.  I did a sudo gem install mysql and got another damn error.</p>
<pre><code>Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... 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.
</code></pre>
<p>Oh good.  Another error.  Perfect.  I searched around the interwebs and someone suggested using &#8220;&#8211;with-mysql-lib=/usr/local/mysql/lib&#8221; in the options since that&#8217;s where the libraries are located.  It still barfed on me with that.</p>
<p><strong>A Solution Please.</strong></p>
<p>A few more minutes of hunting and pecking and I found the golden command:</p>
<pre><code>sudo gem install mysql -- --with-mysql-config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed</code></pre>
<p>Now I don&#8217;t have any errors when starting my rails applications that use MySQL and I&#8217;m closer to what I have in production.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/11/leopard-and-mysql-gem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

