Git Product home page Git Product logo

geoip2's Issues

Setup for rails 4

How do you configure the gem for a rails 4 app?

Not sure where to put the config settings:

Geoip2.configure do |conf|
    # Mandatory
    conf.license_key = 'Your MaxMind License Key'
    conf.user_id = 'Your MaxMind User Id'

    # Optional
    conf.host = 'geoip.maxmind.com' # Or any host that you would like to work with
    conf.base_path = '/geoip/v2.0' # Or any other version of this API
    conf.parallel_requests = 5 # Or any other amount of parallel requests that you would like to use
end

Does not work with hashie 2.1.0+

Running rake when hashie 2.1.1 is installed there are many failures which all look like this:

     Failure/Error: @response = Geoip2.country('62.219.147.28')
     TypeError:
       superclass mismatch for class Rash
     # ./lib/geoip2/client.rb:79:in `block in connection'
     # ./lib/geoip2/client.rb:74:in `connection'
     # ./lib/geoip2/client.rb:39:in `block in get'
     # ./lib/geoip2/client.rb:67:in `call'
     # ./lib/geoip2/client.rb:67:in `block in preform'
     # ./lib/geoip2/client.rb:66:in `preform'
     # ./lib/geoip2/client.rb:38:in `get'
     # ./lib/geoip2/api/country.rb:5:in `country'
     # ./lib/geoip2.rb:65:in `method_missing'
     # ./spec/api/country_spec.rb:7:in `block (4 levels) in '
     # ./spec/api/country_spec.rb:6:in `block (3 levels) in '

Hashie 2.1.1 defines Rash which is different from rash's Rash.

Unable to process in parallel

I get nil when request are made in #parallel_requests block. Irb session:

[43] pry(#)> Geoip2.parallel_requests
=> 5
[44] pry(#)> Geoip2.in_parallel do
[44] pry(#)* r1 = Geoip2.city( "186.56.20.108" )
[44] pry(#)* r2 = Geoip2.city( "190.185.255.244" )
[44] pry(#)* end
=> {}
[45] pry(#)> r1
=> nil
[46] pry(#)> r2
=> nil
[47] pry(#)> r1 = Geoip2.city( "186.56.20.108" ) # standalone call works
=> {"continent"=>
{"geoname_id"=>6255150,
"names"=>
{"de"=>"Südamerika",
...etc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.