I’m pretty new to Ruby, but have a basic grasp. I’m trying to read from
a spreadsheet and then play with the contents once I get them into Ruby.
I tried and tried to get the program to run, but kept getting an error
that the spreadsheet library was missing. I installed the library with
sudo gem install and then my program worked… once. Now, I’m getting
the error again. I’ve uninstalled and re-installed the spreadsheet gem.
Still nothing. Any ideas what could cause this?
Running ruby 1.8.7 (249) on OS X 10.7.3
require 'spreadsheet'
Spreadsheet.client_encoding = 'utf-8'
book = Spreadsheet.open '/Users/robert/Desktop/test_set.xls'
sheet1 = book.worksheet 0
collection = Hash.new()
sheet1.each do |row|
collection.store(row[0], row[1])
end
collection.each do |pair|
puts pair
end
The error I get is:
duplifind.rb:1:in `require’: no such file to load – spreadsheet
(LoadError)
from duplifind.rb:1
Any help is appreciated, although I know this might be difficult to
solve remotely.
Thanks,
Rob.