grover

Schmooze:: Process failed + when using grover gem to convert html2pdf

泄露秘密 提交于 2020-03-25 19:28:05
问题 respond_to do |format| format.html format.pdf do grover = Grover.new('http://localhost:3000/generate_report', format: 'A4') pdf = grover.to_pdf File.open(Rails.root.join('report.pdf'),'wb', encoding: 'ascii-8bit') { |f| f.write(pdf)} end end I need to convert my html page to pdf. But i get a "schmooze process fail" and the system hangs when it does grover.to_pdf. It works well on terminal but not in my rails project. 回答1: It sounds like your system is hanging because when you run Rails in

Schmooze:: Process failed + when using grover gem to convert html2pdf

点点圈 提交于 2020-03-25 19:28:01
问题 respond_to do |format| format.html format.pdf do grover = Grover.new('http://localhost:3000/generate_report', format: 'A4') pdf = grover.to_pdf File.open(Rails.root.join('report.pdf'),'wb', encoding: 'ascii-8bit') { |f| f.write(pdf)} end end I need to convert my html page to pdf. But i get a "schmooze process fail" and the system hangs when it does grover.to_pdf. It works well on terminal but not in my rails project. 回答1: It sounds like your system is hanging because when you run Rails in

How to skip the code execution from PhantomJS or grover

泄露秘密 提交于 2019-12-24 02:33:02
问题 The problem is next: I have JavaScript code in my application and I want to skip/hide some peace of code from PhantomJS and grover checking/execution. So, how can I skip/hide the code execution from PhantomJS or grover? Note: the problem has occurred when I was writing the JavaScript unit-tests. But I think it would be helpful in other cases. 回答1: You just need to wrap the code with simple verification: if (!window['phantom'] && !window['_phantom']) { // your code here... } In this case the

How to skip the code execution from PhantomJS or grover

假如想象 提交于 2019-12-24 02:31:31
问题 The problem is next: I have JavaScript code in my application and I want to skip/hide some peace of code from PhantomJS and grover checking/execution. So, how can I skip/hide the code execution from PhantomJS or grover? Note: the problem has occurred when I was writing the JavaScript unit-tests. But I think it would be helpful in other cases. 回答1: You just need to wrap the code with simple verification: if (!window['phantom'] && !window['_phantom']) { // your code here... } In this case the