<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>&lt;p&gt;I had recently upgraded my MacBook Pro to OS X 10.6 Snow Leopard, and I was in the process of reinstalling most of the ruby gems.&amp;nbsp; The geoip_city gem was the only one that gave me a bit of trouble, so I figured I'd post how I got it working.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go &lt;a title="Maxmind GeoIP source download" href="http://geolite.maxmind.com/download/geoip/api/c/" target="_blank"&gt;here&lt;/a&gt; and download the latest source for the GeoIP C api&lt;/li&gt;
&lt;li&gt;Untar the source, cd into the directory&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;./configure&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Then run &lt;code&gt;make &amp;amp;&amp;amp; sudo make install&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Finally, run &lt;code&gt;sudo env ARCHFLAGS="-arch x86_64" gem install geoip_city -- --with-geoip-dir=/opt/GeoIP&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The key is the &lt;code&gt;ARCHFLAGS&lt;/code&gt; parameter in the last step.&amp;nbsp; This indicates the native extensions are to be built for a 64 bit architecture.&lt;/p&gt;
&lt;p&gt;Also, if you need the free GeoIP City Lite database, you can find it &lt;a title="GeoIP City Lite database download link" href="http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"&gt;here&lt;/a&gt;.&amp;nbsp; I hope this helps.&lt;/p&gt;</body>
  <created-at type="datetime">2009-12-28T19:14:47Z</created-at>
  <description>A quick walk-through of how to install the geoip_city gem on OS X Snow Leopard 10.6.</description>
  <id type="integer">38</id>
  <keywords>snow leopard, osx, geoip, geoip-city, gem, install, ruby, 10.6</keywords>
  <published type="boolean">true</published>
  <slug>geoip-city-gem-on-snow-leopard</slug>
  <title>Geoip_city gem install on Snow Leopard</title>
  <updated-at type="datetime">2009-12-28T19:15:07Z</updated-at>
</post>
