Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method errors after 0.2.18 update #56

Closed
LeptonHeavy opened this issue Apr 28, 2016 · 9 comments
Closed

undefined method errors after 0.2.18 update #56

LeptonHeavy opened this issue Apr 28, 2016 · 9 comments
Labels

Comments

@LeptonHeavy
Copy link

have script that combines latest version of a PDF from several folders in a hierarchy - combining them into a single PDF.

Under 0.2.17 it works as expected - under 0.2.18 I get an error when adding the second pdf to the new document.
error:

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/combine_pdf-0.2.18/lib/combine_pdf/pdf_public.rb:303:in `insert': undefined method `update' for nil:NilClass (NoMethodError)
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/combine_pdf-0.2.18/lib/combine_pdf/pdf_public.rb:275:in `<<'
        from C:/Users/User02/Documents/combinePDF/combine.rb:62:in `block in <main>'
        from C:/Users/User02/Documents/combinePDF/combine.rb:57:in `each'
        from C:/Users/User02/Documents/combinePDF/combine.rb:57:in `<main>'

ruby code

# file_list is an array of PDF files - something like:
# ["R:/Project DS/C/A1_3_151203_Construction.pdf", "R:/Project DS/B/A1_2_160410_Permit_Revisions.pdf","R:/Project DS/C/A1_3_160412_More_Permit_Revisions.pdf"]

pdf_merge = CombinePDF.new
file_list.each do |pdf_file|
  pdf_merge << CombinePDF.load(pdf_file)    
end
boazsegev pushed a commit that referenced this issue Apr 28, 2016
@boazsegev
Copy link
Owner

Hi @LeptonHeavy,

Thank you so much for pointing this out 👍 👍 👍

I uploaded a patched version to github. Could you check that this resolves the issue?

Thanks,
Bo.

@boazsegev boazsegev added the bug label Apr 28, 2016
@EmberSher
Copy link

I'm kind of new to github, so I'm still getting used to the functions of these comments.

I'm still having this same problem. Here's the error again:

C:/Ruby21/lib/ruby/gems/2.1.0/gems/combine_pdf-0.2.18/lib/combine_pdf/pdf_public.rb:303:in 'insert': undefined method 'update' for nil:NilClass (NoMethodError) from C:/Ruby21/lib/ruby/gems/2.1.0/gems/combine_pdf-0.2.18/lib/combine_pdf/pdf_public.rb:275:in '<<' from addinfo.rb:23:in '<main>'

My code is straight out of the combine_pdf.rb, and looks like this:
pdf = CombinePDF.new pdf << CombinePDF.load("file1.pdf") pdf << CombinePDF.load("file2.pdf") pdf.save "combined.pdf"

Since I'm new to github, I might simply not have the patch. I re-downloaded the zip, thinking that might solve the issue, but unfortunately it didn't. I'd love to use this gem for a project I'm working on for a class, though!

@boazsegev
Copy link
Owner

boazsegev commented Apr 28, 2016

After downloading the zip, you need to copy (and overwrite) the pdf_public.rb file to the C:/Ruby21/lib/ruby/gems/2.1.0/gems/combine_pdf-0.2.18/lib/combine_pdf folder (the gem's folder).

After you overwrite the gem installation's file, you should have the patch.

The error might be resolved... of the error might move to a different line.

This week is finals at my collage, so I didn't get around to testing and releasing the patch. I'm not sure why the issue didn't come up with any of my pdf files when I was testing the 0.2.18 version.

boazsegev pushed a commit that referenced this issue Apr 28, 2016
@boazsegev
Copy link
Owner

I released a fixed version (v.0.2.20) - please check that this actually fixes the issue for you.

@EmberSher
Copy link

EmberSher commented Apr 28, 2016

Alrighty! Thanks! I'll take a look right now

@EmberSher
Copy link

It worked! Thank you!

@boazsegev
Copy link
Owner

@EmberSher,

Thanks for letting me know and for reporting this issue and your experience.

@LeptonHeavy thanks again. Let me know if you have any issues, I'm closing this one for now.

@LeptonHeavy
Copy link
Author

confirming that 0.2.20 works for me as well!
thanks for the speedy fix!

@boazsegev
Copy link
Owner

@LeptonHeavy , thanks for keeping me posted 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants