Skip to content

Instantly share code, notes, and snippets.

@dennmart
Created December 17, 2009 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennmart/258788 to your computer and use it in GitHub Desktop.
Save dennmart/258788 to your computer and use it in GitHub Desktop.
GeoIP C API /Gem Install on Intel Mac
# Download the GeoIP C API.
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
# Uncompress and install GeoIP C API from source.
tar zxvf GeoIP-1.4.6.tar.gz
cd GeoIP-1.4.6
env ARCHFLAGS="-arch i386" ./configure --prefix=/srv/GeoIP
env ARCHFLAGS="-arch i386" make
sudo env ARCHFLAGS="-arch i386" make install
# Install the geoip_city gem, using the location where the GeoIP C API was installed.
gem install geoip_city -- --with-geoip-dir=/srv/GeoIP
# If using Ruby Enterprise and Phusion Passenger, install using REE's gem instead.
/opt/ruby-enterprise-1.8.x-xxxx.xx/bin/gem install geoip_city -- --with-geoip-dir=/srv/GeoIP
# Grab the latest copy of the GeoLite City database and place it in the GeoIP C API shared directory.
wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mv GeoLiteCity.dat /srv/GeoIP/share/GeoIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment