I am using Spreadsheet for ruby for creating excel files. Now I want that a excel must be created when it doesnt exist. So I wrote this -:
require 'rubygems'
require 'spreadsheet'
include Spreadsheet
workbook = Spreadsheet.open "data__#{$KEYWORD}.xlsx" rescue Excel.new("data__#{$KEYWORD}.xlsx")
But Always keeps throwing this error -
undefined method `new' for Spreadsheet::Excel:Module (NoMethodError)