From: Omar Campos Date: 2009-12-08T21:36:02+09:00 Subject: Re: How do I know what to require in my ruby script? Stefano Crocco wrote: > On Tuesday 08 December 2009, Omar Campos wrote: >> | After installing a ruby gem, how do I know what string to put in my >> |require statement? thanks for any info. >> | > > Usually, such information is included in the documentation of the gem. > It can > be either in the API documentation which rubygems automatically creates > when > you install the gem or on the gem website. In the case of pdf-writer, > the > project's home page, which you can access from rubyforge, includes a > manual > (http://ruby-pdf.rubyforge.org/pdf-writer/manual/manual.pdf). At the > beginning > of chapter 2, there's a simple example, which begins with the line > > require 'pdf/writer' > > I hope this helps > > Stefano Thanks, this was just what I was looking for. Borrowing from this example, it seems that the require string is the path of the gems .rb file, starting from the /lib/ folder inside the Ruby installation. In the case of the pdf-writer gem, it is /lib/pdf/witer, so the require is pdf/writer/, just like you said. And you're right, it does appear in the docs :) -- Posted via http://www.ruby-forum.com/.