From: Frank Guerino Date: 2009-10-08T09:19:51+09:00 Subject: Re: read CSV file using csv library Marvin G端lker wrote: > Frank Guerino wrote: > Is there anything special I need to do to initialize the class? > > You only required the rubygems library wich is necassary to load Gems > (the packages you can install via RubyGems). So, you need to require > fastercsv, too. > > require "rubygems" > require "fastercsv" > csvData = FasterCSV.read("./dataInput3.csv") > myString = csvData[0][0] > puts myString > > > Btw. the documentation for fastercsv should have been installed along > with the Gem, it should reside in the > lib/ruby/gems//doc/fastercsv subdirectory of your Ruby > installation. But if you're satisfied with the command-line docs, type > $ ri FasterCSV > > Have fun! > > Marvin Hi, I'm still working with my existing 1.8.6 interpreter and getting errors after installing the gem FasterCSV. Here's the code... --------------------------- require "rubygems" require "fastercsv" csvData = FasterCSV.read("./dataInput3.csv") myString = csvData[0][0] puts myString --------------------------- When I run it, I get the following errors... ./fastercsv.rb:53: uninitialized constant FasterCSV (NameError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require' from fasterCSV.rb:50 frank-guerinos-macbook-air:CSV guerino1$ I checked the documentation using "ri FasterCSV" but there doesn't seem to be anything obvious. Any ideas? Thanks, Frank -- Posted via http://www.ruby-forum.com/.