Hi guys problem with running gruff

Hi guys i am pretty much a newbie to rails and tried to install gruff
run the example given in home page for gruff
i am using ubuntu and dapper.

first i got two errors when i used this example
require ‘rubygems’
require ‘gruff’
g = Gruff::Line.new
g.title = “My Graph”
g.data(“Apples”, [1, 2, 3, 4, 4, 3])
g.data(“Oranges”, [4, 8, 7, 9, 8, 9])
g.data(“Watermelon”, [2, 3, 1, 5, 6, 8])
g.data(“Peaches”, [9, 9, 10, 8, 7, 9])
g.labels = {0 => ‘2003’, 2 => ‘2004’, 4 => ‘2005’}

when i replaced require ‘gruff’ with require_gem ‘gruff’ i got rid of
but still this
unintialized name error keeps poppoin when i just run it with ruby

ruby gruff.rb
gruff.rb:4: uninitialized constant Gruff (NameError)

Could u guys plese tell me what i am doing wrong.


Prem Anand Thilagar
Univ Of Texas Arlington

I believe that you need both require ‘gruff’ and the require_gem.
Actually the require_gem is optional as far as I know. But the thing to
remember is that require_gem does not do a require even though you
would think so from the name.