jekyll-import icon indicating copy to clipboard operation
jekyll-import copied to clipboard

rss import fails with ruby 3.1.1p18

Open mknudsen opened this issue 2 years ago • 5 comments

Not a ruby pro so I hope I did this properly:

When running with ruby 3.1.1 doing an import from a remote RSS source fails with the following error:

/usr/local/bundle/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/rss.rb:36:in `initialize': No such file or directory @ rb_sysopen - https://letterboxd.com/kndsn/rss/ (Errno::ENOENT)
	from /usr/local/bundle/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/rss.rb:36:in `open'
	from /usr/local/bundle/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/rss.rb:36:in `process'
	from /usr/local/bundle/gems/jekyll-import-0.21.0/lib/jekyll-import/importer.rb:25:in `run'
	from -e:2:in `<main>'

You can see the whole log here, I created a repo isolating the issue as much as I could.

Let me know if you need any other information.

mknudsen avatar Apr 15 '22 08:04 mknudsen

Hey @mknudsen, that importer is meant to be run with a file on your computer. Download the XML file at the URL and pass the file path here instead of the URL.

parkr avatar Apr 16 '22 01:04 parkr

Sure about that? In this documentation it says:

The source field is required and can be either a local file or a remote one.

Also it does work with a link with a 2.x ruby on my machine.

mknudsen avatar Apr 16 '22 05:04 mknudsen

Looks like we should update the code, then. In Ruby 3.0, they removed that from Kernel#open: https://stackoverflow.com/a/66032553

parkr avatar Apr 16 '22 14:04 parkr

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master/main branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Jun 16 '22 14:06 jekyllbot

The issue here is likely around the removal of remote support from open() in Ruby 3.x. We'll need to figure out another way to support this.

In the meantime, you can download your file to disk and the importer should run from that file on your machine.

parkr avatar Jun 16 '22 21:06 parkr

I'm also experiencing this issue. Remote URLs can't be opened. Does anyone have a workaround?

Screenshot 2022-10-12 at 10 32 37 PM

jekyll 3.9.2 ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin18] Using jekyll-import 0.21.0 from https://github.com/pew/jekyll-import.git (at master@3250d6f) rss 0.2.9

lagosnomad avatar Oct 12 '22 21:10 lagosnomad

Easiest thing to do is download the file and run off your local machine. Next thing to try is using Ruby 2.7.

parkr avatar Oct 12 '22 23:10 parkr

Easiest thing to do is download the file and run off your local machine. Next thing to try is using Ruby 2.7.

Yes, exactly what I'm doing now. Downloading and saving first before running other actions on the file. Downgrading to 2.7 would be a mess.

Thanks

lagosnomad avatar Oct 13 '22 00:10 lagosnomad

Hi, looks like with ruby 3, we need to use URI.open. I changed it and created #489 PR along with some more changes. For this specific issue, you can refer https://github.com/jekyll/jekyll-import/pull/489/commits/405295af62d0d0067d6489a8ff31944b026e3aa2

sumanmaity112 avatar Nov 07 '22 19:11 sumanmaity112

Fixed by #489.

parkr avatar Mar 05 '23 23:03 parkr