Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
Created December 13, 2013 22:36
Show Gist options
  • Save jamesgecko/4c72555e484269c1929c to your computer and use it in GitHub Desktop.
Save jamesgecko/4c72555e484269c1929c to your computer and use it in GitHub Desktop.
geocode_to_zip = {} # line 15
CSV.foreach(geolite_csv) do |locId,country,region,city,postalCode,latitude,longitude,metroCode,areaCode|
if country == 'US'
puts "#{city}, #{postalCode}, #{metroCode}"
geocode_to_zip[metroCode] = postalCode
end
end
, ,
/Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1855:in `sub!': invalid byte sequence in UTF-8 (ArgumentError)
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1855:in `block in shift'
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1849:in `loop'
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1849:in `shift'
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1791:in `each'
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1208:in `block in foreach'
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1354:in `open'
from /Users/jdent/.rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/csv.rb:1207:in `foreach'
from generate.rb:15:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment