I'm in the dark here. What should I do to get this thing started?
This is the closest thing I've found to a solution, but it doesn't work for me. Sinatra: Template engine not found: prawn
Edit: I'm at a very very early stage. I literally want to just try to make a hello world in Prawn, and from there I'll add my content in. Something like this (app.rb):
require 'prawn'
get 'report/' do
content_type 'application/pdf'
pdf = Prawn::Document.new
pdf.text "Hello World"
pdf.render
end
Your code works perfectly for me, except that I had to change the path from "report/" to "/report" (because that's what Sinatra sees when you go to
'http://localhost:4567/report/
).
The exact code that I ran is:
require 'sinatra'
require 'prawn'
get '/report/' do
content_type 'application/pdf'
pdf = Prawn::Document.new
pdf.text "Hello World"
pdf.render
end
and here's my ruby version:
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.2.1]
I think you must be incredibly close.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With