0

I have a Rails app running on heroku. Now I want to run a rake task (which uses a model of my rails app) and geo-tag each record using the MaxMind GeoIP database (http://www.maxmind.com/app/geolite).

Using this database in a Ruby application involves :

  1. Building it's C-API (http://www.maxmind.com/app/c) and then
  2. Build the Ruby bindings for that (http://www.maxmind.com/app/ruby).

I could do this on my local machine and successfully get the country codes from IP addresses. However I do not know how to install these libraries on Heroku. From what I understand the ruby bindings are not available as a gem with native extensions (which heroku would have handled just fine). Also their C-API seems to have a few other dependencies which makes me wonder whether such a thing is possible at all.

So has anyone installed the MaxMind GeoIP (a.k.a Net::GeoIP) on Heroku? If yes how?

I could run the rake task from my laptop by pointing my local setup to the production DB. Before that I would like to know if I can run it from my Heroku setup itself to avoid latency or connection breakdown etc.

brahmana
  • 1,286
  • 12
  • 24

1 Answers1

0

I found a gem which bundles the MaxMind C-API and provides it's own Ruby API. It works just fine - http://rubygems.org/gems/geoip

I ll tentatively accept this as the answer. However it would be awesome if someone can tell me how to install binary extensions to Ruby on Heroku.

brahmana
  • 1,286
  • 12
  • 24