dohliam / jekyll-offline

Jekyll Offline - Turn any Jekyll site into an offline application with relative links
https://dohliam.github.io/jekyll-offline/
17 stars 4 forks source link

undefined method `encode' for URI:Module #2

Open jazzlw opened 2 years ago

jazzlw commented 2 years ago

Getting an error when trying to run the demo. /Users/jazzlw/src/jekyll-offline/lib_rellinks.rb:13:in 'relativize': undefined method 'encode' for URI:Module (NoMethodError) Looks like this is a depreciated method that no longer exists... Ruby version: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]

dohliam commented 2 years ago

@jazzlw Thanks for raising this issue! Yes, I also encountered this same error some time ago when trying to generate a new offline site. I managed to fix it in my local copy but didn't get around to porting that fix here. In theory you should be able to get this working just by removing the URI.encode and URI.decode calls entirely. I will test this out and try to upload a working version ASAP.

mkerley commented 1 year ago

Hello 👋 I tried removing the URI.encode and URI.decode calls but that led to other errors. I ended up with the solution in #3.

Nawretard commented 5 months ago

Hello, I also fixed the error (because I didn't notice the previous pull request). I had another error where links to the current page didn't work, so I did some refactoring to make the code clearer and fix it too.

During the process,

That led to #4, thanks for developing this tool in the first place @dohliam !