From: Lyle Johnson Date: 2008-05-15T03:25:28+09:00 Subject: Re: PDF::Writer and rubygems On Wed, May 14, 2008 at 12:47 PM, Bill Woodward wrote: > I then update it to use rubygems by changing the 'require' section of > the code to: > > require 'rubygems' > gem 'pdf-writer' > > but when I do that, I get an error: > > /home/wpwood/Desktop/pdf_writer-1.1.8/demo/hello.rb:14: uninitialized > constant PDF (NameError) > > on the line: > > pdf = PDF::Writer.new > > I'm fairly new to Ruby, and new to trying to use gems directly, and it's > certainly possible that I'm doing something wrong. So, can anyone tell > me what I'm doing wrong? You were close. You need to say: require 'rubygems' to load the RubyGems runtime support, then: gem 'pdf-writer' to activate that gem, and finally, require 'pdf/writer' to require that specific module (for the PDF::Writer class definition). Hope this helps, Lyle