1

I am attempting to install pdf-extract on Mac OS X Yosemite. I assume it's better not to use the /usr/bin/ruby that comes with Yosemite, so I'm using the Macports version, /opt/local/bin/ruby (ver2.1.3).

The installation appears to go fine:

sudo port install ruby
sudo port install rb-rubygems
sudo port select --set ruby ruby21
which ruby   #/opt/local/bin/ruby
which gem    #/opt/local/bin/gem

sudo gem install pdf-extract

At the end of the last command, the message appears to indicate that all went well:

...
Done installing documentation for Ascii85, afm, commander, hashery, highline, libsvm-ruby-swig, mini_portile, nokogiri, pdf-core, pdf-extract, pdf-reader, prawn, ruby-rc4, sqlite3, ttfunk after 30 seconds
15 gems installed

However, when I attempt to run pdf-extract, I ran into the following error:

$ cd bin/
$ ./pdf-extract extract --titles journal.pdf
/opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:384:in `block in require_program': program version required (Commander::Runner::CommandError)
    from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:383:in `each'
    from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:383:in `require_program'
    from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:51:in `run!'
    from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
    from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/import.rb:10:in `block in <top (required)>'
/private/tmp/pdfextract/lib/pdf/extract/references/score.rb:11:in `<module:Score>': uninitialized constant Libsvm::Model (NameError)
    from /private/tmp/pdfextract/lib/pdf/extract/references/score.rb:4:in `<module:PdfExtract>'
    from /private/tmp/pdfextract/lib/pdf/extract/references/score.rb:3:in `<top (required)>'
    from /private/tmp/pdfextract/lib/pdf/extract/references/references.rb:3:in `require_relative'
    from /private/tmp/pdfextract/lib/pdf/extract/references/references.rb:3:in `<top (required)>'
    from /private/tmp/pdfextract/lib/pdf/extract.rb:10:in `require_relative'
    from /private/tmp/pdfextract/lib/pdf/extract.rb:10:in `<top (required)>'
    from /private/tmp/pdfextract/lib/pdf-extract.rb:1:in `require_relative'
    from /private/tmp/pdfextract/lib/pdf-extract.rb:1:in `<top (required)>'
    from ./pdf-extract:5:in `require_relative'
    from ./pdf-extract:5:in `<main>'

My question is whether I've done the gem install correctly (and therefore it's probably a bug in pdf-extract) or whether I've messed up something in the installation (or in the file paths).

Side note: the installation folder was initially $HOME/Dropbox/code/ruby/pdf-extract, but I carried out a mv pdf-extract /tmp (to shorten the file paths in the error messages) and re-ran the install scripts (the error message essentially remained the same). I also tried replacing ./pdf-extract with /opt/local/bin/ruby2.1 pdf-extract but it did not help.

nathanielng
  • 1,645
  • 1
  • 19
  • 30

0 Answers0