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

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -