tricon / instapaper-to-pdf

Archive your Instapaper items to PDFs. With support for importing to DEVONthink!
33 stars 3 forks source link

`require': cannot load such file -- mechanize (LoadError) #4

Open ahaghgoo opened 4 years ago

ahaghgoo commented 4 years ago

Hi, I tried to run this but I get the following result. I'm not experienced with command line so please forgive me if this is an easy fix. Thanks for your time and consideration!

ruby instapaper_to_pdf.rb Traceback (most recent call last): 2: from instapaper_to_pdf.rb:15:in

' 1: from`/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mechanize (LoadError)``

tricon commented 4 years ago

@ahaghgoo Thanks for opening this issue.

The quickest way to get up and running would be to run this command from the command line:

sudo gem install bundler

Then from this project's folder:

sudo bundle install

This will install a couple things you need to run the Ruby script.

Please let me know if this resolves your issue, and I'll get this added to the README.

ahaghgoo commented 4 years ago

Thanks David for the quick reply!

After running the second command, I came upon this result:

sudo bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Fetching gem metadata from http://rubygems.org/.......... Using bundler 2.1.2 Using htmldoc 0.2.3 Fetching nokogiri 1.4.4 Installing nokogiri 1.4.4 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.4.4/ext/nokogiri

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20191219-9945-1iurjk4.rb extconf.rb extconf.rb failed Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) extconf.rb:10:in `

': uninitialized constant Config (NameError) Did you mean? RbConfig CONFIG

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.4.4 for inspection. Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/nokogiri-1.4.4/gem_make.out

An error occurred while installing nokogiri (1.4.4), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.4.4' --source 'http://rubygems.org/' succeeds before bundling.

In Gemfile: mechanize was resolved to 1.0.0, which depends on nokogiri

-- Afshin Haghgoo ahaghgoo@ucla.edu

On Dec 19, 2019, at 10:13, David Aaron Fendley notifications@github.com wrote:

@ahaghgoo Thanks for opening this issue.

The quickest way to get up and running would be to run this command from the command line:

sudo gem install bundler

Then from this project's folder:

sudo bundle install

This will install a couple things you need to run the Ruby script.

Please let me know if this resolves your issue, and I'll get this added to the README.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

tricon commented 2 years ago

My apologies for letting this issue language. Did you ever get this resolved?