Comments (18)
Can you paste your controller code?, line 16 of pdf_helper is being called because your call to render doesn't have the :pdf key like so:
render :pdf => 'name_of_pdf'
from wicked_pdf.
unixmonkey: thanks for your answaer. I just follow the install guide and reinit the mongrel server and then i got the error, I've not written a single code line yet.
thanks in advance for your help.
from wicked_pdf.
i've installed in a centos 5.5 over a amd64 box, the old instalation was in a i386 box and i got the same problem. Did i miss something ? i just follow the install guide, reinit and the problem comes out.
from wicked_pdf.
I'm trying. I installed 1.9.1 and Rails 3 & wicked_pdf and its at least booting here.
Rails 2.3.11 and Webrick are working too, but I can't get mongrel to even build on 1.9.1
What version of Rails, and which wkhtmltopdf binary do you have?
from wicked_pdf.
im using rails 2.3.8 and wkhtmltopdf 10
Daniel.
On Wed, Mar 30, 2011 at 6:07 PM, unixmonkey <
[email protected]>wrote:
I'm trying. I installed 1.9.1 and Rails 3 & wicked_pdf and its at least
booting here.
Rails 2.3.11 and Webrick are working too, but I can't get mongrel to even
build on 1.9.1What version of Rails, and which wkhtmltopdf binary do you have?
Reply to this email directly or view it on GitHub:
#29 (comment)
from wicked_pdf.
This error is always raised with Ruby 1.9.2-p180.
render_without_wicked_pdf(options, *args, &block)
That line triggers it.
from wicked_pdf.
Edit: Rails 2.3.8 and 2.3.11
from wicked_pdf.
I can confirm that Wicked PDF does not work with the following on OS X 10.6.7, Rails 3.0.6 and wkhtmltopdf 0.9.9:
ruby 1.9.2.-p180
ruby 1.9.1-p376
In both cases I get a "SystemStackError (stack level too deep)". The relevant controller code used is:
format.pdf {
render :pdf => @horse.name, # .pdf is automatically appended by Wicked PDF
:template => 'horses/show.pdf.erb',
:layout => 'pdf.html',
:footer => {
:center => "Center",
:left => "Left",
:right => "Right"
}
}
The template and layout exists and everything works just fine with ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0].
from wicked_pdf.
I am experiencing the same issue with Ruby 1.9.2-p180
After much spelunking, it looks like it is failing, very specifically, at:
html_string = render_to_string(:template => options[:template], :layout => options[:layout])
in make_pdf in lib/pdf_helper.rb.
I am beginning to suspect that it keeps calling itself because there might be some other plugin aliasing render and causing some sort of conflict. As it turns out, i am using inherit_views and inherited_resources which i know for sure that inherit_views aliases render. I will post more when i figure out exactly how to fix this.
from wicked_pdf.
right on, nice work penguin. post again when you find a fix.
from wicked_pdf.
I found the fix, but there is still another issue i have not yet worked out having to do with Ruby19 and character encodings.
I am out for the evening; the Predators are playing the Ducks and i have to go get my McRinne jersey and watch the game. I will look into the encoding issue tomorrow.
from wicked_pdf.
I've merged penguincoder's work into master. Please let me know if this helps.
from wicked_pdf.
Just tested your latest version with OS X 10.6.7, RVM, Ruby 1.9.2 and the issue is resolved. Great work everyone!
from wicked_pdf.
Failed to execute /usr/local/bin/wkhtmltopdf: undefined method `capture3' for Open3:Module
In Ruby 1.8.7
Looks like a call to RUBY_VERSION is in order to penguincoder's commit.
from wicked_pdf.
No problem running it on OS X 10.6.7 with standard 1.8.7.
Also tried RVM versions of REE and 1.8.7-p334 apart from the earlier testing of 1.9.2-p180.
No issues with my testapp over at https://github.com/DevL/shownotes/tree/master/SHRUG_2011-04-13_PDF/wicked
from wicked_pdf.
Hey guys, look at this (from $RUBYHOME/lib/open3.rb in 1.9.2)
popen3(*cmd, opts) {|i, o, e, t|
if binmode
i.binmode
o.binmode
e.binmode
end
out_reader = Thread.new { o.read }
err_reader = Thread.new { e.read }
i.write stdin_data
i.close
[out_reader.value, err_reader.value, t.value]
}
If we just call binmode on the stdout variable, it should work with the old code.
from wicked_pdf.
@clifton, you are right, capture3 isn't in older 1.8.7, I missed that being on ree-1.8.7-2010.02, but it definitely isn't in p160
@penguincoder, I saw that and backported it to wicked_pdf's call to popen3.
@DevL, Thanks for the presentation link. I used it to make sure the encoding stuff works. Also, you don't need to specify the template if its named after the action; and a better way to install wkhtmltopdf for a rails app these days is just add "gem 'wkhtmltopdf-binary'" to the Gemfile.
All, thanks for your help. Please let me know if there are any further issues.
from wicked_pdf.
Right on. Thanks for giving this issue attention. I'll update
wicked_pdf on our application when its working in 1.8.7 and 1.9.2.
This was an issue holding back our code migration to 1.9.2.
On Mon, Apr 18, 2011 at 2:53 PM, unixmonkey
[email protected]
wrote:
@clifton, you are right, capture3 isn't in older 1.8.7, I missed that being on ree-1.8.7-2010.02, but it definitely isn't in p160
@penguincoder, I saw that and backported it to wicked_pdf's call to popen3.
All, thanks for your help. Please let me know if there are any further issues.
Reply to this email directly or view it on GitHub:
#29 (comment)
from wicked_pdf.
Related Issues (20)
- Add support for --load-error-handling and --load-media-error-handling
- Remote asset returning non-200 response does not trigger an error
- Greek Character "𝛼" not showing correctly within PDF generated by Wicked PDF HOT 7
- Images won't load from Active Storage using Amazon S3 Bucket HOT 2
- version 2.7.0 breaks with webpacker
- Content is getting cropped in PDF
- ActionView::Template::Error uninitialized constant WickedPdf::WickedPdfHelper::Assets::SprocketsEnvironment::Sprockets HOT 3
- Feature Request: PDF/A-1
- pdf_from_url CSS not working HOT 1
- Raw PDF being rendered. HOT 1
- OpenStruct causes NameError in Rake13.2.0
- PDF is being rendered with raw ERB code HOT 4
- Content overlaps with the header layout
- RuntimeError on PDf Generation HOT 1
- wicked_pdf due to wkhtmltopdf not finding OpenSSL 1.1 despite installing over OpenSSL 3 HOT 7
- Remove usage of `OpenStruct` or add `ostruct` as dependency
- v2.8.0 causing ActionView::Template::Error: no implicit conversion of nil into String for first time in years HOT 7
- ArgumentError when changing the WickedPdf.config={...} to the new WickedPdf.configure.do |c| ... end HOT 1
- Error: PDF could not be generated! HOT 1
- Public assets not getting loaded after upgrade to Rails 7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wicked_pdf.