Tuesday, August 15, 2006

uninitialized constant FPDF - Ruby on Rails View Page Code

Background:
Trying to use my first Rails plugin - Rfpdf and after following the instructions on the RoR Rfpdf documentation page, my page fails to load. Checking the associated forum didn't help - it's probably something easy because it's the first thing I've ever done anything with Rails.

Problem Description:
when trying:
pdf = FPDF.new()

the following error message is occuring:
uninitialized constant FPDF

I think the problem is that I attempted to install Rfpdf using:
ruby script/plugin install svn://rubyforge.org//var/svn/rfpdf

however it appears that that particular command line syntax is Subversion specific and I did not yet have Subversion installed.

Problem Solution:
Kind of straight-forward and ugly but I downloaded the source from:
http://rubyforge.org/projects/rfpdf/

and copied it into my vendor/profiles directory in my rails application source. I could have downloaded Subversion and done it properly, but apparently we don't use that here at my workplace.