Skip to content

Instantly share code, notes, and snippets.

@bkilshaw
Created September 27, 2012 19:01
Show Gist options
  • Save bkilshaw/806e41d7208ffe94f6cf to your computer and use it in GitHub Desktop.
Save bkilshaw/806e41d7208ffe94f6cf to your computer and use it in GitHub Desktop.
>> require 'open-uri'
=> true
>> require 'csv'
=> true
>> csv = open("http://www.cbsa-asfc.gc.ca/bwt-taf/bwt-eng.csv")
=> #<StringIO:0x00000100842f00>
>> puts CSV.parse(csv.read, ";;")
TypeError: can't convert String into Hash
from /Users/bradkilshaw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/csv.rb:1554:in `merge'
from /Users/bradkilshaw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/csv.rb:1554:in `initialize'
from /Users/bradkilshaw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/csv.rb:1362:in `new'
from /Users/bradkilshaw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/csv.rb:1362:in `parse'
from (irb):4
from /Users/bradkilshaw/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment