# Question about require and pdf-writer

**URL:** <https://www.ruby-forum.com/t/question-about-require-and-pdf-writer/57231>\
**Category:** Ruby\
**Created:** [April 8, 2006, 6:41am UTC](https://www.ruby-forum.com/t/question-about-require-and-pdf-writer/57231 "2006-04-08T06:41:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [April 8, 2006, 6:41am UTC](https://www.ruby-forum.com/t/question-about-require-and-pdf-writer/57231/1 "2006-04-08T06:41:43Z")

</div>

I am just begining with Ruby (decent overall programming background  
though) and I’m looking to try out the pdf-writer ruby gem.

I read the guide from the pdf-writer author, Austin Z.  
([artima - Creating Printable Documents with Ruby](http://www.artima.com/rubycs/articles/pdf_writer4.html)) and I’m having  
a small problem which is I’m sure, indicative of my shallow  
understanding of Ruby 🙂

So here’s my problem:

I’d like to use the SimpleTable class, and in the article I was directed  
to put:

require ‘pdf/writer’  
require ‘pdf/simpletable’

which makes sense, except i’m used rubygems to install pdf-writer and  
that apparently changes the way I use require, namely:  
require ‘rubygems’  
require\_gem ‘pdf-writer’

NOW:) I can’t figure out how to 'require" the SimpleTable class

I’m running OSX Tiger and I have my whole ruby and rails set up in  
/usr/local (I followed the instructions in  
[Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger))

Long setup to a simple question I know, but I like to cover everything  
🙂

cheers and thanks in advance!

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [April 8, 2006, 7:13am UTC](https://www.ruby-forum.com/t/question-about-require-and-pdf-writer/57231/2 "2006-04-08T07:13:11Z")

</div>

On 4/8/06, Andrew [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> require ‘pdf/writer’  
> require ‘pdf/simpletable’
> 
> which makes sense, except i’m used rubygems to install pdf-writer and  
> that apparently changes the way I use require, namely:

Not really. All you need to do is:

require ‘rubygems’  
require ‘pdf/writer’  
require ‘pdf/simpletable’

That’s it.

You do not need require\_gem at all; when you need the capabilities  
offered by require\_gem in the future, it will have been renamed to  
something else (probably activate\_gem or fix\_gem or something like  
that).

-austin

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [April 8, 2006, 7:12pm UTC](https://www.ruby-forum.com/t/question-about-require-and-pdf-writer/57231/3 "2006-04-08T19:12:24Z")

</div>

Thank you very much, thatt worked AND I learned something!!!

Austin Z. wrote:

> On 4/8/06, Andrew [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > require ‘pdf/writer’  
> > require ‘pdf/simpletable’
> > 
> > which makes sense, except i’m used rubygems to install pdf-writer and  
> > that apparently changes the way I use require, namely:
> 
> Not really. All you need to do is:
> 
> require ‘rubygems’  
> require ‘pdf/writer’  
> require ‘pdf/simpletable’
> 
> That’s it.
> 
> You do not need require\_gem at all; when you need the capabilities  
> offered by require\_gem in the future, it will have been renamed to  
> something else (probably activate\_gem or fix\_gem or something like  
> that).
> 
> -austin

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [October 27, 2006, 10:42am UTC](https://www.ruby-forum.com/t/question-about-require-and-pdf-writer/57231/4 "2006-10-27T10:42:22Z")

</div>

Austin Z. wrote:

> On 4/8/06, Andrew [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > require ‘pdf/writer’  
> > require ‘pdf/simpletable’
> > 
> > which makes sense, except i’m used rubygems to install pdf-writer and  
> > that apparently changes the way I use require, namely:
> 
> Not really. All you need to do is:
> 
> require ‘rubygems’  
> require ‘pdf/writer’  
> require ‘pdf/simpletable’
> 
> That’s it.
> 
> You do not need require\_gem at all; when you need the capabilities  
> offered by require\_gem in the future, it will have been renamed to  
> something else (probably activate\_gem or fix\_gem or something like  
> that).
> 
> -austin

Hi,

im getting this error when i call the image function:

“undefined method `image’ for #PDF::Writer:0x364a930”

these are my requires:

require ‘rubygems’  
require ‘pdf/writer’

checking on rdoc, the image function is in this → image  
(PDF::Writer::Graphics)

im on windows xp.

thanks  
/franee
