Ruby roo gem: comparison of Fixnum with nil failed (ArgumentError) -


for xls reading using 'roo' gem, time getting error.

rails 4

gem roo (1.13.2)

require 'roo' class helptextmigration  def self.data_do    roo::excel.new("/home/kanna/files/article.xls").each |line|      puts "---------{line}----------"    end end 

error:

/home/kannan/.rvm/gems/ruby-2.1.2@rails4-cms-development/gems/roo-1.13.2/lib/roo/base.rb:427:in `>': comparison of fixnum nil failed (argumenterror) 

in console

 2.1.2 :131 > roo::excel.new("/home/kanna/files/article.xls").first_row  => nil 

from looking @ code if seems first_row return nil if default sheet (or first sheet, if did not assign default sheet) not have non-empty lines.

check file see if maybe empty, or if first sheet empty.


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -