Hi guys problem with running gruff

Hi guys i am pretty much a newbie to rails and tried to install gruff
and
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
#!/usr/bin/ruby
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’}
g.write(‘my_fruity_graph.png’)

when i replaced require ‘gruff’ with require_gem ‘gruff’ i got rid of
one
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.

thanks
prem

Prem Anand Thilagar
Univ Of Texas Arlington
TX,76010
USA

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.

Wes

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs