Code Monkey home page Code Monkey logo

Comments (5)

cjheath avatar cjheath commented on July 30, 2024

On 08/06/2011, at 10:04 PM, vitobotta wrote:

Hi, I am trying to use this gem in an app, but for some reason the
GeoIP class cannot be found:
ree-1.8.7-2011.03 :001 > require 'geoip'
=> true
ree-1.8.7-2011.03 :002 > GeoIP
NameError: uninitialized constant GeoIP
from (irb):2

Am I missing something?

That's very strange; something must be wrong with your gem
configuration.
Try this:

before = Object.constants
require 'geoip'
p Object.constants-before

That will tell you what global constants (if any) were added by
requiring geoip.

Also, where does "gem show geoip" open up?

Clifford Heath.

from geoip.

vitobotta avatar vitobotta commented on July 30, 2024

Thanks a lot for the quick reply :)

Earlier I was trying the gem with the IRB console, when I got the error. But now I am using it with the Rails console -after adding the gem to the Gemfile as usual- and it works.
I need it with a Rails app now so it's OK :)

Anyway
1)

ree-1.8.7-2011.03 :004 > p Object.constants-before
["Autometal", "FileUtils"]

501 [ ~ ] $ gem show geoip
ERROR: While executing gem ... (RuntimeError)
Unknown command show

but..

502 [ ~ ] $ gem list geoip

*** LOCAL GEMS ***

geoip (1.1.1)

Everything looks otherwise fine on my system and I don't have any other problem apart this (I am using RVM and have also tried to downgrade RubyGems just in case), so I wouldn't know why this is happening.
But anyway with Rails it's working correctly.

Thanks!
Vito

On 8 Jun 2011, at 14:34, cjheath wrote:

On 08/06/2011, at 10:04 PM, vitobotta wrote:

Hi, I am trying to use this gem in an app, but for some reason the
GeoIP class cannot be found:
ree-1.8.7-2011.03 :001 > require 'geoip'
=> true
ree-1.8.7-2011.03 :002 > GeoIP
NameError: uninitialized constant GeoIP
from (irb):2

Am I missing something?

That's very strange; something must be wrong with your gem
configuration.
Try this:

before = Object.constants
require 'geoip'
p Object.constants-before

That will tell you what global constants (if any) were added by
requiring geoip.

Also, where does "gem show geoip" open up?

Clifford Heath.

Reply to this email directly or view it on GitHub:
#13 (comment)

from geoip.

cjheath avatar cjheath commented on July 30, 2024

On 08/06/2011, at 11:41 PM, vitobotta wrote:

ree-1.8.7-2011.03 :004 > p Object.constants-before
["Autometal", "FileUtils"]

.... but no Geoip. Weird. I wonder what Autometal is, it sounds
like a loader type thing that might have interfered with the
require process.

501 [ ~ ] $ gem show geoip
ERROR: While executing gem ... (RuntimeError)

Oh sorry, I meant "gem open", but "gem list" is also good.

502 [ ~ ] $ gem list geoip
*** LOCAL GEMS ***
geoip (1.1.1)

And you're using bundler too? Is the bundle up to date?

Clifford Heath.

from geoip.

vitobotta avatar vitobotta commented on July 30, 2024

Hi Clifford,

thanks - yes I do use bundler and it's up to date. I think I found what the problem was: I had tried another gem (I think autometal-geoip) before finding yours, and it seems like it hadn't beed uninstalled cleanly.
So I don't think it's a problem with your gem :)

On a side note, after playing with the gem and seeing some results, I noticed that the GeoCity Lite database by Maxmind is not good enough for the kind of lookups I need to do, which is mostly IP addresses owned by ISPs and alike.
In these cases, the Lite version of the database doesn't usually return the city at all and while the full version does, it's a bit pricey for my needs.

So luckily I found another service which seems a good fit for what I am trying to do
http://www.readwriteweb.com/hack/2010/09/saying-hi-quova-style.php

I don't need frequent lookups nor many of them during a day, so this seems to work ok for me (for now), although it's a remote service.

Cheers
Vito

On 8 Jun 2011, at 22:21, cjheath wrote:

On 08/06/2011, at 11:41 PM, vitobotta wrote:

ree-1.8.7-2011.03 :004 > p Object.constants-before
["Autometal", "FileUtils"]

.... but no Geoip. Weird. I wonder what Autometal is, it sounds
like a loader type thing that might have interfered with the
require process.

501 [ ~ ] $ gem show geoip
ERROR: While executing gem ... (RuntimeError)

Oh sorry, I meant "gem open", but "gem list" is also good.

502 [ ~ ] $ gem list geoip
*** LOCAL GEMS ***
geoip (1.1.1)

And you're using bundler too? Is the bundle up to date?

Clifford Heath.

Reply to this email directly or view it on GitHub:
#13 (comment)

from geoip.

rtyler avatar rtyler commented on July 30, 2024

I believe this issue could be closed 😸

from geoip.

Related Issues (20)

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.