Forum: Ruby question about require and pdf-writer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrew (Guest)
on 2006-04-08 08:41
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.
(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
http://hivelogic.com/articles/2005/12/01/ruby_rail...)

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

cheers and thanks in advance!
Austin Z. (Guest)
on 2006-04-08 09:13
(Received via mailing list)
On 4/8/06, Andrew <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
Andrew (Guest)
on 2006-04-08 21:12
Thank you very much, thatt worked AND I learned something!!!



Austin Z. wrote:
> On 4/8/06, Andrew <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
Francis S. (Guest)
on 2006-10-27 12:42
Austin Z. wrote:
> On 4/8/06, Andrew <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
This topic is locked and can not be replied to.