If your Rails (in my case Rails 4.2.11) app also uses the okcomputer gem, then you'll get a SystemStackError when trying to visit the /okcomputer url. Works fine with version 1.1.0 of wicked_pdf.
Should be able to use okcomputer gem as well as wicked_pdf
wicked_pdf gem version (output of cat Gemfile.lock | grep wicked_pdf):
Problem occurs with wicked_pdf 1.2.0, 1.2.1 and 1.2.2
wkhtmltopdf version (output of wkhtmltopdf --version):
whtmltopdf provider gem and version if one is used:
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar):
@BlakeWard I wonder if this is related to https://github.com/mileszs/wicked_pdf/issues/823 I'm also having this issue where I'm trying to override ActionController::Base's render method by using Module#prepend but because of the aliasing done by WickedPDF for render, it's hitting a stack overflow error.
Yes, I think that's related. Both gems mess with render.
It's planned for WickedPdf 2.0 to define a renderer with the Rails renderers.add method or a base wicked_pdf(options) method you can call from the controller, instead of messing with render itself.
I'd like it to first be opt-in to deprecate the override and bridge compatibility to a 2.0 release, where we drop the alias/prepend code altogether.
I've been pretty busy lately though, so I'd love it if you or someone else reading this could help me out.
If it helps, here's the hack I'm currently using to get around this problem:
def render_without_wicked_pdf(*options, &block)
m = method(:render)
until m.nil? || m.owner == ActionController::Rendering
m = m.super_method
end
m&.(*options, &block)
end
Most helpful comment
Yes, I think that's related. Both gems mess with
render.It's planned for WickedPdf 2.0 to define a renderer with the Rails
renderers.addmethod or a basewicked_pdf(options)method you can call from the controller, instead of messing withrenderitself.I'd like it to first be opt-in to deprecate the override and bridge compatibility to a 2.0 release, where we drop the alias/prepend code altogether.
I've been pretty busy lately though, so I'd love it if you or someone else reading this could help me out.