prawnpdf / prawn

Fast, Nimble PDF Writer for Ruby
https://prawnpdf.org
Other
4.65k stars 687 forks source link

LoadError: cannot load such file -- prawn/table #754

Closed MartinMcDermid closed 10 years ago

MartinMcDermid commented 10 years ago

I had my pdfs running great the other day, but since the latest update(?), my pdfs are broken with this error message.

require 'open-uri'
require 'prawn/table'

pdf.bounding_box([300,330], :width => 250, :height => 400) do
    table_data = [[Prawn::Table::Cell::Text.new( pdf, [0,0], :content => "<b>Cab Type: </b>", :inline_format => true), "#{@vehicle.cab_type.name if @vehicle.cab_type}"],
               [Prawn::Table::Cell::Text.new( pdf, [0,0], :content => "<b>Wheelbase (mm):</b>", :inline_format => true), "#{@vehicle.wheelbase if @vehicle.wheelbase}"]]
    pdf.table(table_data,:width => 250)
 end

end
bvogel commented 10 years ago

I think you'll get more chances to someone really looking into this if you reduce your problem to a assertable test case and include the least amount of well formatted code to reproduce the problem. Also you never included an error/stack trace. (Did you read the change log note about table being a separate gem now?)

MartinMcDermid commented 10 years ago

Yeah, I'll rewrite! Thanks.

practicingruby commented 10 years ago

@MartinMcDermid: Sorry, I didn't notice in my (now deleted) comment that you are requiring "prawn/table". Make sure you also require "prawn" first, and that should solve the problem.

MartinMcDermid commented 10 years ago

@sandal That's it running great! Yeah quite silly of me to miss that. Appreciate the help!