<?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>Note to Self &#187; MySQL</title>
	<atom:link href="http://notetoself.vrensk.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://notetoself.vrensk.com</link>
	<description>lest I forget</description>
	<lastBuildDate>Fri, 23 Feb 2018 12:54:38 +0000</lastBuildDate>
	<language>sv-SE</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Mysql gem on OS X Leopard</title>
		<link>http://notetoself.vrensk.com/2008/07/mysql-gem-on-os-x-leopard/</link>
		<comments>http://notetoself.vrensk.com/2008/07/mysql-gem-on-os-x-leopard/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 14:03:54 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Developer Client]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[works for me]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=9</guid>
		<description><![CDATA[Installing the mysql gem for Ruby is almost always a mess, as witnessed by the large number of hits one get when googling for &#8220;mysql gem leopard&#8221;.  To make the gem work with your platform, you need to ensure that the &#8216;make&#8217; command run internally by &#8216;gem&#8217; has the right ARCHFLAGS, which most of the [...]]]></description>
				<content:encoded><![CDATA[<p>Installing the mysql gem for Ruby is almost always a mess, as witnessed by the <a href="http://www.notsostupid.com/blog/2007/10/25/ruby-leopard-and-gems/" onclick="pageTracker._trackPageview('/outgoing/www.notsostupid.com/blog/2007/10/25/ruby-leopard-and-gems/?referer=');">large</a> <a href="http://www.schmidp.com/2007/9/29/rails-mysql-and-leopard" onclick="pageTracker._trackPageview('/outgoing/www.schmidp.com/2007/9/29/rails-mysql-and-leopard?referer=');">number</a> <a href="http://www.rubyhead.com/2007/10/29/mysql-gem-in-leopard/" onclick="pageTracker._trackPageview('/outgoing/www.rubyhead.com/2007/10/29/mysql-gem-in-leopard/?referer=');">of</a> <a href="http://weblog.rubyonrails.org/2007/10/26/today-is-leopard-day" onclick="pageTracker._trackPageview('/outgoing/weblog.rubyonrails.org/2007/10/26/today-is-leopard-day?referer=');">hits</a> one get when googling for &#8220;mysql gem leopard&#8221;.  To make the gem work with your platform, you need to ensure that the &#8216;make&#8217; command run internally by &#8216;gem&#8217; has the right ARCHFLAGS, which most of the web pages will tell you about.  So</p>
<pre>sudo env ARCHFLAGS='-arch i386' gem install mysql</pre>
<p>should handle it, more or less.  But since Leopard (the client version) does not have mysql, you will have had to install that on your own (I installed the MySQL binary package for 10.4, from <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg" onclick="pageTracker._trackPageview('/outgoing/dev.mysql.com/downloads/mysql/5.0.html_macosx-dmg?referer=');">dev.mysql.com</a>, because there was no 10.5 package available the day after I Leopard was released), and &#8216;gem&#8217; isn&#8217;t good at guessing where it is.  So I need to say</p>
<pre>sudo env ARCHFLAGS='-arch i386' gem install mysql -- --with-mysql-dir=/usr/local/mysql</pre>
<p>But for some reason that is not quite enough either.  I get this error:</p>
<pre>/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9):
Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib (LoadError)

  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
      from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `require'
      from my_script.rb:6</pre>
<p>Hey, look at that.  It actually tries to load the lib from `/usr/local/mysql/lib/mysql` rather than `/usr/local/mysql/lib`.  Why?  I don&#8217;t know.  I couldn&#8217;t be bothered to dive into the code, so I went for the quick workaround:</p>
<pre>sudo ln -s . /usr/local/mysql/lib/mysql</pre>
<p>Silly, and perhaps not the cleanest way to do it, but it works for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/07/mysql-gem-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
