jruby IO.popen read hangs in action when requests are made to the local dev server
问题 I just want to send the output of wkhtmltopdf to the user. It shouldn't be so hard. def it send_pdf "file.pdf" end def send_pdf(file) url= url_for(params) # Example: http://localhost:3000/report/it webkit= Rails.root.join('app', 'bin', 'wkhtmltopdf', 'current') cmd= "#{webkit} -q \"#{url_for(params)}\" -" data= IO.popen(cmd).read ############### HANGS HERE ################### send_data(data, type: "application/pdf", filename: file) end Why does it hang and how to fix it? 回答1: I think the clue