Skip to content

Instantly share code, notes, and snippets.

@reshleman
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reshleman/d8dd9882ca89e01d1bbe to your computer and use it in GitHub Desktop.
Save reshleman/d8dd9882ca89e01d1bbe to your computer and use it in GitHub Desktop.
Roo: NoMethodError: undefined method `each_pair' for nil:NilClass
irb(main):001:0> require "roo"
=> true
irb(main):002:0> require "roo/version"
=> true
irb(main):003:0> Roo::VERSION
=> "2.0.0"
irb(main):004:0> sheet = Roo::Spreadsheet.open("/Users/reshleman/Desktop/roo_error.csv", extension: "csv")
=> #<Roo::CSV:0x007feb3c97d5b8>
irb(main):005:0> sheet.parse(name: "name")
=> [{:name=>"name"}, {:name=>"Robert Eshleman"}]
irb(main):006:0> sheet.parse(name: "name", clean: true)
NoMethodError: undefined method `each_pair' for nil:NilClass
from /Users/reshleman/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/roo-2.0.0/lib/roo/base.rb:526:in `clean_sheet'
from /Users/reshleman/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/roo-2.0.0/lib/roo/base.rb:329:in `clean_sheet_if_need'
from /Users/reshleman/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/roo-2.0.0/lib/roo/base.rb:372:in `each'
from /Users/reshleman/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/roo-2.0.0/lib/roo/base.rb:387:in `parse'
from (irb):6
from /Users/reshleman/.rbenv/versions/2.2.0/bin/irb:11:in `<main>'
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
name Robert Eshleman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment