I’m trying to install the yob pdf reader: https://github.com/yob/pdf-reader#readme
My script has the following code:
reader = PDF::Reader.new("1.pdf")
when I run that script I get the following error:
`initialize': wrong number of arguments (1 for 0) (ArgumentError)
Which doesn’t make any sense because the directions say this should be done this way.
How do I solve this?
p.s.
gem list command produces:
*** LOCAL GEMS ***
Ascii85 (1.0.1)
bundler (1.0.18)
columnize (0.3.4)
linecache (0.46)
nokogiri (1.5.0)
pdf-reader (0.10.0)
rbx-require-relative (0.0.5)
rdoc (3.9.4, 2.5.11)
rdoc-data (2.5.3)
ruby-debug (0.10.4)
ruby-debug-base (0.10.4)
rudebug (0.3.2)
syntax (1.0.0)
gem -v produces: 1.3.7
You most likely have a gem version conflict. You can specify the version of the gem that you want to require, in case you have multiple versions installed:
Update
I would slap myself if I could. There’s nothing wrong with your setup. The instructions to use
PDF::Reader.new "my_file.pdf"are for the git version.Check the examples directory for the version 0.10.0 to get examples of how to use the library.