<?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>sylv3rblade dot com &#187; mysql gem</title>
	<atom:link href="http://sylv3rblade.com/tag/mysql-gem/feed/" rel="self" type="application/rss+xml" />
	<link>http://sylv3rblade.com</link>
	<description>Enjoying a Geek&#039;s Life with Anime, Rails, and Digital Photography!</description>
	<lastBuildDate>Thu, 02 Feb 2012 10:17:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing the mysql gem on OS X 10.6 (Snow Leopard)</title>
		<link>http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/</link>
		<comments>http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 13:00:46 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[mysql gem]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.sylv3rblade.com/?p=21</guid>
		<description><![CDATA[The first thing on my developer itinerary after getting my MacBook Pro is to install my development tools. That includes upgrading the ruby and rails gem versions packaged with OS X 10.6 and installing Xcode which is included on Snow (&#8230;)</p><p><a href="http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.sylv3rblade.com/wp-content/uploads/2010/04/ruby-gem.png" alt="" title="MySQL Gem" width="117" height="113" class="alignright size-full wp-image-33" />The first thing on my developer itinerary after getting my MacBook Pro is to install my development tools.  That includes upgrading the ruby and rails gem versions packaged with OS X 10.6 and installing Xcode which is included on Snow Leopard&#8217;s install DVD.  Things proceed smoothly until I tried to install the mysql gem.</p>
<p>Ruby threw a fit and dumped this message:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
</pre>
<p>After some google-fu, I found out that when installing the mysql gem on OS X, you need to point it to where your mysql_config file is placed.  Below is the complete guide on how to how to install the mysql gem on Snow Leopard.</p>
<ul>
<li>Download your preferred MYSQL version from the <a href="http://dev.mysql.com/downloads/mysql/">community download site</a>.  If you&#8217;re on Snow Leopard, you may want to install the 64-bit version.</li>
<li>Install mysql via dmg or compile it from source.</li>
<li>Type &#8216;which mysql_config’ on the terminal to locate said config.  Take note of this location as we&#8217;ll use it on the next step.</li>
<li>Install the mysql gem with the command below.  If the location for your mysql config is different with the one below, use that instead.
<pre class="brush: bash; title: ; notranslate">
 sudo env ARCHFLAGS=&quot;-Os -arch x86_64 -fno-common&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
</pre>
<p>Note that if you&#8217;re using the 32-bit version, you have to use:</p>
<pre class="brush: bash; title: ; notranslate">
 sudo env ARCHFLAGS=&quot;-Os -arch i386 -fno-common&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
</pre>
</li>
<li>And success!
<pre class="brush: bash; title: ; notranslate">
$  sudo env ARCHFLAGS=&quot;-Os -arch x86_64 -fno-common&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1...
...
</pre>
</li>
</ul>
<p>If you are having problems, or have any suggestions, please post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

