It has to do with the ruby version.

In Ruby 1.8.6, the String class does not have the method bytes. But in
Ruby 1.8.7 the String class does.

So I bet you have 1.8.6 on your Ubuntu and 1.8.7 on your OSX.

Thanks,
Edmond

On Jan 26, 5:47 pm, Pete Campbell <[email protected]> wrote:
> 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 method `bytes' 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
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to