Prawn and nginx

7 views
Skip to first unread message

Hugo

unread,
Jun 5, 2010, 9:26:02 AM6/5/10
to Prawn
Hi all,

I'm moving my application from a shared host to a VPS.
In the shared host I'm using Apache + Passenger + Rails and it works
fine.
In the VPS I'm using Nginx + Passenger + Rails and it does not work.
When I make a request to the server to create a pdf file it hangs. I
don't see any error in the log files. Can anyone help me?

Here is the code:

# rails action.
def teste

invoice = HelloReport.new
output = invoice.to_pdf

respond_to do |format|
format.pdf do
send_data (output, :filename => "hello.pdf", :type => "application/
pdf")
end
end

end

# pdf creator
class HelloReport < Prawn::Document
def to_pdf
text "Hello world"
font "Helvetica"
text "Book: title", :size => 16, :style => :bold, :spacing => 4
text "Author: author", :spacing => 16
text "Author: author222222", :spacing => 16

bounding_box [100, cursor], :width => 200, :height => 200 do
stroke do
circle_at [100,100], :radius => 100
line bounds.top_left, bounds.bottom_right
line bounds.top_right, bounds.bottom_left
end
end

render
end
end

Thanks.
Best regards,
Hugo

Anuj Dutta

unread,
Jun 5, 2010, 12:11:26 PM6/5/10
to prawn...@googlegroups.com
Hello,

Does your prawn code work on its own? Just try doing that and narrow the problem down. Also, what version of passenger are you using?? It could be a passenger problem.

Sorry, could not be of much help.

Thanks.

Anuj

------------------

Hugo

unread,
Jun 6, 2010, 11:11:06 AM6/6/10
to Prawn
Hi,

I found the problem.
I forgot to install pdf-reader!

Thanks for your help!

Best regards,
Hugo
Reply all
Reply to author
Forward
0 new messages