[Locomotive-users] Requiring Gems

Ryan Raaum ryan.raaum at gmail.com
Mon Aug 27 10:12:26 GMT 2007


On 8/27/07, Rick Shafer <ras_kcir at mac.com> wrote:
> OK... I can see that this topic has appeared several times, at least
> by doing a google, but I can't seem to be able to decode/apply any of
> the solutions (which often seem to be "oops, now its working"... I
> hate that sort of solution when my situation isn't working).
>
> Here is the situation...
> I am running Locomotive 2.0.8 with the RMagick Rails Mar 2007
> bundle.   I am running on a dual G5.  OS 10.4.10.
>
>   I wanted to use the PDF::Writer package.   So, I went into the
> Locomotive launched terminal window for my project and ran:
> gems update pdf-writer
> It prompted me for several dependencies (I said yes), it built two
> kinds of documentation (rdoc was one of them), and then I got a
> prompt, and assumed that it had installed... somewhere....  (I seemed
> to find it but it was WAY deep and in multiple places (though some of
> it is the rdoc.... and a CVS entry?)).  The docs were in "PDF/Writer"
> as opposed to "pdf/writer".
>
> Locomotive2/Bundles/rmagickRailsMar2007_ppc.locobundle/framework/lib/
> ruby/gems/1.8/gems/pdf-writer-1.1.3/lib/pdf/writer/
>
> The documentation for PDF::Writer included a "hello world" example,
> which I wanted to test.
> require "pdf/writer"
>        pdf = PDF::Writer.new
>        pdf.select_font "Times-Roman"
>        pdf.text "Hello, Ruby.", :font_size => 24, :justification
> => :center
>        pdf.save_as("hello.pdf")
>
> I saved this as a simple file testwriter.rb at the top of my rails
> app hierarchy, and then at the terminal prompt say
>
> ruby testwriter.rb
>
> whereupon, I get the message
> testwriter.rb:5:in `require': no such file to load -- pdf/writer
> (LoadError)
>          from testwriter.rb:5
>
> So, what am I doing wrong?  Is it in gems?  ruby?  Locomotive?  bad
> karma?

add

require 'rubygems'

to the beginning of that example.

-r

>
> Thanks for your attention.
> _______________________________________________
> Locomotive-users mailing list
> Locomotive-users at lists.raaum.org
> http://lists.raaum.org/mailman/listinfo/locomotive-users
>


More information about the Locomotive-users mailing list