Giter Site home page Giter Site logo

Comments (10)

billgreenwald avatar billgreenwald commented on July 20, 2024

It seems that the setup script didn't install camping properly.

can you try running
sudo gem install camping

and try it again assuming that works?

from pubmed-batch-download.

joannadiong avatar joannadiong commented on July 20, 2024

Tried but didn't work. This is the version of camping that installed:

[17:34] ~$ sudo gem install camping
[sudo] password for joanna: 
Successfully installed camping-2.1.532
1 gem installed
Installing ri documentation for camping-2.1.532...
Installing RDoc documentation for camping-2.1.532...

Running script produced same error, reproduced here for completeness:

[17:34] ~/.../Pubmed-Batch-Download$ ruby pubmedid2pdf.rb 26830047,26728431
/home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- camping (LoadError)
    from /home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/joanna/Dropbox/Sketchbook/ruby/Pubmed-Batch-Download/pdfetch.rb:27:in `<top (required)>'
    from /home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from pubmedid2pdf.rb:37:in `<main>'

from pubmed-batch-download.

billgreenwald avatar billgreenwald commented on July 20, 2024

I just installed it on another computer fresh to test, and I couldn't replicate the error. I'm having trouble figuring out what is causing it. Did you have ruby installed before you began? The only thing I could think of is that it may be running 2.1.0 after you installed camping for 2.1.2 as you have

/site_ruby/2.1.0

in your file path.

Perhaps try

rvm use ruby2.1.2

or the appropriate version

from pubmed-batch-download.

joannadiong avatar joannadiong commented on July 20, 2024

Thanks Bill. I also tried installation on another computer and still got the load error. Here are my installation steps/ hitches along the way, if it helps show the problem and for new users too:

Install RVM from instructions here:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby

Received error:

curl: (77) error setting certificate verify locations:
  CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none

From here, the issue is that curl expected the certificate to be at the path /etc/pki/tls/certs/ca-bundle.crt but could not find it because it was at the path /etc/ssl/certs/ca-certificates.crt.

Copy certificate to the expected destination by running:

sudo mkdir -p /etc/pki/tls/certs
sudo cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt

Re-run RVM install command:

\curl -sSL https://get.rvm.io | bash -s stable --ruby

source /home/joanna/.rvm/scripts/rvm
rvm install 2.1.2
rvm use 2.1.2

cd /home/joanna/Dropbox/Sketchbook/ruby/Pubmed-Batch-Download/
bash setup.sh
ruby pubmedid2pdf.rb 26830047,26728431 

Please let me know if you spot grievous mistakes in the process, and/or itemise how you installed it on a fresh computer. Otherwise I will work on this a little longer before trying elsewhere. Thanks

from pubmed-batch-download.

billgreenwald avatar billgreenwald commented on July 20, 2024

The certfile error is probably a property of Mint--it shouldn't be from this program.

What was the problem with your final ruby run with the line below?

ruby pubmedid2pdf.rb 26830047,26728431

from pubmed-batch-download.

joannadiong avatar joannadiong commented on July 20, 2024

Received same error:

[16:33] ~/.../Pubmed-Batch-Download$ ruby pubmedid2pdf.rb 26830047,26728431 
/home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- camping (LoadError)
    from /home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/joanna/Dropbox/Sketchbook/ruby/Pubmed-Batch-Download/pdfetch.rb:27:in `<top (required)>'
    from /home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/joanna/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from pubmedid2pdf.rb:37:in `<main>'

from pubmed-batch-download.

billgreenwald avatar billgreenwald commented on July 20, 2024

Try cloning the CampingFix branch and see if it works now--I tried a fix I found from some searching online

Alternatively if that still doesn't work, check if your apache is being run from the same user (suggested from here )

It's also worth a quick check that if you launch the ruby shell and load camping, if the error comes up. This can be done via

ruby
require 'rubygems'
require 'camping'

and seeing if any errors pop up

from pubmed-batch-download.

joannadiong avatar joannadiong commented on July 20, 2024

Tried a different route. I also chatted with Andy Shen about the problem. He worked out that the ruby that is in the $PATH is not the same one that installed camping rubygem. Ie. camping did not install in the rvm gem:

[09:34] ~$ rvm use 2.1.2
Using /home/joanna/.rvm/gems/ruby-2.1.2
[09:34] ~$ which ruby
/home/joanna/.rvm/rubies/ruby-2.1.2/bin/ruby
[09:34] ~$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
[09:35] ~$ which gem
/home/joanna/.rvm/rubies/ruby-2.1.2/bin/gem
[09:35] ~$ gem list camping

*** LOCAL GEMS ***

The solution was to install camping (and also mechanize) in the rvm gem:

rvm use 2.1.2
which gem
gem list camping mechanize
gem install camping
gem install mechanize
gem list camping mechanize

Subsequently, the pubmedid2pdf script ran, except that it failed to fetch PDFs of records that have PDFs, but that might be another issue...

[12:03] ~/.../Pubmed-Batch-Download$ ruby pubmedid2pdf.rb 26830047,26728431
Trying to fetch 26830047
Trying blackwell_synergy
Trying cell_press
Trying choose_science_direct
Trying coldspringharbour
Trying direct_pdf_link
Trying humana_press
Trying ingenta_connect
Trying jbc
Trying nature
Trying nature_reviews
Trying pnas
Trying pubmed_central
Trying science_direct
Trying springer_link
Trying unknown
Trying wiley
Trying zeneric
Trying zframe
** fetching of reprint 26830047 failed
Trying to fetch 26728431
Trying blackwell_synergy
Trying cell_press
Trying choose_science_direct
Trying coldspringharbour
Trying direct_pdf_link
Trying humana_press
Trying ingenta_connect
Trying jbc
Trying nature
Trying nature_reviews
Trying pnas
Trying pubmed_central
Trying science_direct
Trying springer_link
Trying unknown
Trying wiley
Trying zeneric
Trying zframe
** fetching of reprint 26728431 failed

from pubmed-batch-download.

billgreenwald avatar billgreenwald commented on July 20, 2024

As far as the actual script itself failing, I've found it's mainly from not being on a network that has access to the articles. Otherwise, I'm not sure how to fix the html parser--I only updated the dependencies and syntax for Ruby 2.0. Let me know if there are any more questions, otherwise I will close this soon.

from pubmed-batch-download.

joannadiong avatar joannadiong commented on July 20, 2024

I ran the script on a university computer on the ethernet for PubMed IDs with or without "Free full text" but could not retrieve PDFs. But in relation to the installation issue, happy to close. Thank you.

from pubmed-batch-download.

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.