views:

127

answers:

1

Is there a way to get geoip_city, the Ruby gem, running on Windows?

A: 

Have you read the documentation?? I found the following instructions there:

Install

Some variation of the following should work.

  1. Install the GeoCity C library. You can get it from here www.maxmind.com/app/c For example, I like to install mine in /opt/GeoIP so I do this:

    tar -zxvf GeoIP-1.4.3.tar.gz
    cd GeoIP-1.4.3
    ./configure --prefix=/opt/GeoIP
    make && sudo make install
    
  2. Now install the geoip_city gem

    sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP
    
  3. Download the GeoLite City database file in binary format from: www.maxmind.com/app/geolitecity Maybe this direct link will work: www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz I put this file in /opt/GeoIP/share/GeoIP/GeoLiteCity.dat

  4. Use it!


On Windows, the gem installs like any other gem:

gem install geoip_city -- --with-geoip-dir=/opt/GeoIP

Just make sure that ruby\bin directory is in your path or you run the above command from the ruby\bin directory.

But the required MaxMind library and database takes a little more work. You will need an application that can uncompress tar.gz files such as 7zip. The link to the MaxMind library specifically mentions Windows installation instructions are contained in the archive.

The database is just a binary file, so once you've uncompressed it you're good to go.

EmFi
Are you implying that windows has tar, and can run bash scripts like ./configure and have / as directory separators, like /opt/GeoIP? I've read the documentation, if that works on windows I'll be really surprised if that worked on Windows.
J. Pablo Fernández
No. I am implying that, had you done due diligence in looking at the linked library you would know that it is easily installed in Windows. The required tar and gunzip may be missing but I've linked to a suitable alternative.
EmFi