wayback-machine-downloader icon indicating copy to clipboard operation
wayback-machine-downloader copied to clipboard

(Errno::ENOENT)| No such file or directory @ rb_sysope

Open Julienvaralda opened this issue 4 years ago • 2 comments

impossible to execute???


usersession@MacBook ~ % wayback_machine_downloader http://monsite.com Downloading http://monsite.com to websites/monsite.com/ from Wayback Machine archives.

Getting snapshot pages/Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader/archive_api.rb:8:in initialize': No such file or directory @ rb_sysopen - http://web.archive.org/cdx/search/xd?url=http://monsite.com&fl=timestamp,original&collapse=digest&gzip=false&filter=statuscode:200 (Errno::ENOENT) from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader/archive_api.rb:8:in open' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader/archive_api.rb:8:in get_raw_list_from_api' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:88:in get_all_snapshots_to_consider' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:105:in get_file_list_curated' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:168:in get_file_list_by_timestamp' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:309:in file_list_by_timestamp' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/lib/wayback_machine_downloader.rb:192:in download_files' from /Users/usersession/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/wayback_machine_downloader-2.2.1/bin/wayback_machine_downloader:72:in <top (required)>' from /Users/usersession/.asdf/installs/ruby/3.0.0/bin/wayback_machine_downloader:23:in load' from /Users/usersession/.asdf/installs/ruby/3.0.0/bin/wayback_machine_downloader:23:in <main>' usersession@MacBook-Pro ~ % which ruby /Users/usersession/.asdf/shims/ruby usersession@MacBook-Pro ~ % which wayback_machine_downloader /Users/usersession/.asdf/shims/wayback_machine_downloader

Julienvaralda avatar Apr 06 '21 22:04 Julienvaralda

This is due to a change that came with Ruby 3. I am quoting Stackoverflow here:

open-uri used to (before Ruby 3.0) overwrite Kernel#open with its own version which also supports reading from external URLs rather than simply opening local files or running commands.

Thus, you need to replace open in ../lib/wayback_machine_downloader/archive_api.rb:8 with URI.open and it will work again. This should have been adressed by the latest pull-request but this commit somehow isn't in the Ruby Gem version yet.

Maturion avatar Apr 24 '21 08:04 Maturion

I think this has been fixed in commit 30475c5 and version 2.3.0, please upgrade.

@hartator you might want to close this issue.

pabs3 avatar Jun 07 '21 09:06 pabs3