I have the GeoIP gem working in my local environment (OSX), but when I
move the code to our dev server (Ubuntu) via scp then it doesn’t work -
it
looks like the file is being treated like a text file instead of binary:
g = GeoIP.new(“#{RAILS_ROOT}/lib/GeoIP.dat”)
NoMethodError: undefined methodbytes' for "ved":String from /var/www/apps/buwebsite/releases/20110126214815/vendor/gems/geoip-0.8.9/lib/geoip.rb:672:in
initialize’
from
/var/www/apps/buwebsite/releases/20110126214815/vendor/gems/geoip-0.8.9/lib/geoip.rb:671:in
upto' from /var/www/apps/buwebsite/releases/20110126214815/vendor/gems/geoip-0.8.9/lib/geoip.rb:671:in
initialize’
from (irb):1:in `new’
from (irb):1
Any thoughts? I’m now considering a MySQL based approach which seems
like it has less potential for problems:
http://ipinfodb.com/ip_database.php
Thanks
Pete