ruby install yob pdf reader
I'm trying to install the yob pdf reader: https://github.com/yob/pdf-reader#readme
I'm following the directions there and do:
gem install 开发者_C百科pdf-reader
and that reports success.
I place a pdf in my directory, name it 1.pdf
.
Then I create a script that has the following code:
reader = PDF::Reader.new("1.pdf")
when I run that script I get the following error:
uninitialized constant PDF (NameError)
Googling it hasn't been very successful so far.
How do I solve this?
If it's a pure ruby script, you may be missing the following at the beginning:
require 'rubygems'
require 'pdf-reader'
You can also specify the version of the gem that you want to require, in case you have multiple versions installed:
require 'rubygems'
gem 'pdf-reader', "~> 0.10.0"
require 'pdf-reader'
精彩评论