Giter Site home page Giter Site logo

Comments (18)

unixmonkey avatar unixmonkey commented on August 27, 2024

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.

dafevara avatar dafevara commented on August 27, 2024

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.

dafevara avatar dafevara commented on August 27, 2024

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.

unixmonkey avatar unixmonkey commented on August 27, 2024

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.

dafevara avatar dafevara commented on August 27, 2024

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.1

What 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.

clifton avatar clifton commented on August 27, 2024

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.

clifton avatar clifton commented on August 27, 2024

Edit: Rails 2.3.8 and 2.3.11

from wicked_pdf.

DevL avatar DevL commented on August 27, 2024

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.

penguincoder avatar penguincoder commented on August 27, 2024

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.

clifton avatar clifton commented on August 27, 2024

right on, nice work penguin. post again when you find a fix.

from wicked_pdf.

penguincoder avatar penguincoder commented on August 27, 2024

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.

unixmonkey avatar unixmonkey commented on August 27, 2024

I've merged penguincoder's work into master. Please let me know if this helps.

from wicked_pdf.

DevL avatar DevL commented on August 27, 2024

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.

clifton avatar clifton commented on August 27, 2024

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.

DevL avatar DevL commented on August 27, 2024

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.

penguincoder avatar penguincoder commented on August 27, 2024

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.

unixmonkey avatar unixmonkey commented on August 27, 2024

@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.

clifton avatar clifton commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.