Ruby Error when accessing xlsx file using roo. This script was working until recently my system crashed and then I had to reinstall the latest versions of Ruby and Roo. now I am getting uninitialized constant Excelx.new (NamedError). The name a locatio of the file is correct, even hardcoding the filename presents the same error.
I am running Ruby 1.9.3 and Roo 1.10.2 Here is the relevant part of the code:
require 'rubygems' require 'roo'
class Fixnum def zeros "%0#{self}d" % 0 end end
class String def numeric? # Check if every character is numeric !!self.match(/^[0-9]+$/) end end
class BudgetParser def initialize(options) @budgetfile=File.basename(options[:file], '.*') @filename = ("#{File.expand_path(File.dirname(__FILE__))}/#{options[:file]}") print(@filename.force_encoding(::Encoding::UTF_8)) @workbook = Excelx.new(@filename.force_encoding(::Encoding::UTF_8)) @workbook.default_sheet = options[:sheet] || 'Sheet1' @budget_year = options[:year] || Time.new.year.to_s @conversions = %w(} J K L M N O P Q R) import end
Any help would be appreciated!