# Hi guys problem with running gruff

**URL:** <https://www.ruby-forum.com/t/hi-guys-problem-with-running-gruff/87095>\
**Category:** Rails\
**Created:** [February 28, 2007, 3:13am UTC](https://www.ruby-forum.com/t/hi-guys-problem-with-running-gruff/87095 "2007-02-28T03:13:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prem\_anand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecb155/32.png) [@prem\_anand](https://www.ruby-forum.com/u/prem_anand)\
**Post date:** [February 28, 2007, 3:13am UTC](https://www.ruby-forum.com/t/hi-guys-problem-with-running-gruff/87095/1 "2007-02-28T03:13:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prem\_anand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecb155/32.png) [@prem\_anand](https://www.ruby-forum.com/u/prem_anand)\
**Post date:** [February 28, 2007, 5:48am UTC](https://www.ruby-forum.com/t/hi-guys-problem-with-running-gruff/87095/2 "2007-02-28T05:48:41Z")

</div>

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
