aarongustafson / jekyll-webmention_io

A Jekyll Plugin for rendering Webmentions via Webmention.io
https://aarongustafson.github.io/jekyll-webmention_io/
MIT License
139 stars 27 forks source link

Plugin not working with either Ruby 3.0.1 and 2.7.3 #147

Closed xplosionmind closed 3 years ago

xplosionmind commented 3 years ago

Error with 3.0.1

Even if it seems that the problem is caused by a corrupted CSV, when I comment out jekyll-webmention_io from my webring I solve the problem. This is the error I get:

Configuration file: /Users/tommi/tommi.space/_config.yml
            Source: /Users/tommi/tommi.space
       Destination: /Users/tommi/tommi.space/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
bundler: failed to load command: jekyll (/Users/tommi/.rbenv/versions/3.0.1/bin/jekyll)
/Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/csv.rb:1656:in `read': wrong number of arguments (given 2, expected 1) (ArgumentError)
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/readers/data_reader.rb:57:in `read_data_file'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/readers/data_reader.rb:46:in `block in read_data_to'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/readers/data_reader.rb:38:in `each'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/readers/data_reader.rb:38:in `read_data_to'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/readers/data_reader.rb:20:in `read'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/reader.rb:18:in `read'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/site.rb:164:in `read'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/site.rb:69:in `process'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/command.rb:28:in `process_site'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/commands/build.rb:65:in `build'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/commands/build.rb:36:in `process'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:93:in `block in start'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:93:in `each'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:93:in `start'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/jekyll-3.9.1/exe/jekyll:15:in `<top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.1/bin/jekyll:23:in `load'
    from /Users/tommi/.rbenv/versions/3.0.1/bin/jekyll:23:in `<top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `load'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `kernel_load'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/cli/exec.rb:28:in `run'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/cli.rb:494:in `exec'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bundler-2.2.15/libexec/bundle:49:in `block in <top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/3.0.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    from /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bundler-2.2.15/libexec/bundle:37:in `<top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.1/bin/bundle:23:in `load'
    from /Users/tommi/.rbenv/versions/3.0.1/bin/bundle:23:in `<main>'



Error with 2.7.3

Again, if I comment out this plugin there are no errors anymore. This is what I get:

Configuration file: /Users/tommi/tommi.space/_config.yml
            Source: /Users/tommi/tommi.space
       Destination: /Users/tommi/tommi.space/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
[jekyll-webmention_io] Webmentions won’t be gathered when running `jekyll serve`.
bundler: failed to load command: jekyll (/Users/tommi/.rbenv/versions/2.7.3/bin/jekyll)
NoMethodError: undefined method `[]=' for nil:NilClass
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-webmention_io-3.3.5/lib/jekyll/generators/gather_webmentions.rb:24:in `generate'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/site.rb:175:in `block in generate'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/site.rb:173:in `each'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/site.rb:173:in `generate'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/site.rb:70:in `process'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/command.rb:28:in `process_site'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/commands/build.rb:65:in `build'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/commands/build.rb:36:in `process'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:93:in `block in start'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:93:in `each'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:93:in `start'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
  /Users/tommi/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/jekyll-3.9.1/exe/jekyll:15:in `<top (required)>'
  /Users/tommi/.rbenv/versions/2.7.3/bin/jekyll:23:in `load'
  /Users/tommi/.rbenv/versions/2.7.3/bin/jekyll:23:in `<top (required)>'



Context

For more context, allow me to paste below the content of some other files:

Gemfile

source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "webrick"
  gem "jekyll-feed"
  gem "jekyll-seo-tag"
  gem "jekyll-sitemap"
  gem "jekyll-last-modified-at"
  gem "jekyll-target-blank"
  gem "jekyll-watch"
  gem "jekyll-redirect-from"
  gem "jekyll-email-protect"
  gem "jekyll-datapage-generator"
  gem "jekyll-debug"
  gem "jekyll-mentions"
  gem "jekyll-liquify"
  gem "jekyll-auto-image"
  gem "html-proofer"
  gem "jekyll-toc"
  gem "jekyll-webmention_io" # this causes trouble
end

Bundle update

bundle update output:

Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies......
Using concurrent-ruby 1.1.8
Using minitest 5.14.4
Using thread_safe 0.3.6
Using zeitwerk 2.4.2
Using public_suffix 4.0.6
Using bundler 2.2.15
Using eventmachine 1.2.7
Using colorator 1.1.0
Using coderay 1.1.3
Following files may not be writable, so sudo is needed:
  /Users/tommi/.rbenv/versions/3.0.1/bin
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/build_info
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/doc
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/plugins
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/specifications
Using http_parser.rb 0.6.0
Using forwardable-extended 2.6.0
Using mercenary 0.3.6
Using rainbow 3.0.0
Using yell 2.2.2
Using multi_xml 0.6.0
Using rb-fsevent 0.10.4
Using rexml 3.2.5
Using liquid 4.0.3
Using safe_yaml 1.0.5
Using method_source 1.0.0
Using rb-readline 0.5.5
Using jekyll-email-protect 1.1.0
Using posix-spawn 0.3.15
Using redcarpet 3.5.1
Using json 2.5.1
Using openssl 2.2.0
Using string_inflection 0.1.2
Using link_header 0.0.8
Using webrick 1.7.0
Using i18n 0.9.5
Using addressable 2.7.0
Using tzinfo 1.2.9
Using pathutil 0.16.2
Using httparty 0.15.7
Using em-websocket 0.5.2
Using kramdown 2.3.1
Using liquid-c 4.0.0
Using pry 0.14.1
Using jekyll-datapage-generator 1.3.0
Using activesupport 6.0.3.6
Using jekyll-debug 0.0.2
Using execjs 2.7.0
Using racc 1.5.2
Using uglifier 4.2.0
Using nokogiri 1.11.3 (x86_64-darwin)
Using jekyll-liquify 0.0.2
Using html-pipeline 2.14.0
Using ffi 1.15.0
Using rouge 3.26.0
Using ethon 0.13.0
Using nokogumbo 2.0.5
Using webmention 0.1.6
Using parallel 1.20.1
Using rb-inotify 0.10.1
Using htmlbeautifier 1.3.1
Using sass-listen 4.0.0
Using typhoeus 1.4.0
Using sass 3.7.4
Using html-proofer 3.19.0
Using jekyll-sass-converter 1.5.2
Using listen 3.5.1
Using jekyll-watch 2.2.1
Using jekyll 3.9.1
Using jekyll-auto-image 1.1.3
Using jekyll-toc 0.17.0
Using jekyll-webmention_io 3.3.5
Using jekyll-mentions 1.6.0
Using jekyll-redirect-from 0.16.0
Using jekyll-seo-tag 2.7.1
Using jekyll-sitemap 1.4.0
Using jekyll-target-blank 2.0.0
Using jekyll-feed 0.15.1
Using jekyll-last-modified-at 1.3.0
Bundle updated!
~/tommi.space [main●] » b
Using concurrent-ruby 1.1.8
Following files may not be writable, so sudo is needed:
  /Users/tommi/.rbenv/versions/3.0.1/bin
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/build_info
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/doc
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/plugins
  /Users/tommi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/specifications
Using i18n 0.9.5
Using minitest 5.14.4
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using zeitwerk 2.4.2
Using activesupport 6.0.3.6
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bundler 2.2.15
Using coderay 1.1.3
Using colorator 1.1.0
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.2
Using ffi 1.15.0
Using ethon 0.13.0
Using execjs 2.7.0
Using forwardable-extended 2.6.0
Using racc 1.5.2
Using nokogiri 1.11.3 (x86_64-darwin)
Using html-pipeline 2.14.0
Using mercenary 0.3.6
Using nokogumbo 2.0.5
Using parallel 1.20.1
Using rainbow 3.0.0
Using typhoeus 1.4.0
Using yell 2.2.2
Using html-proofer 3.19.0
Using htmlbeautifier 1.3.1
Using multi_xml 0.6.0
Using httparty 0.15.7
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.5.1
Using jekyll-watch 2.2.1
Using rexml 3.2.5
Using kramdown 2.3.1
Using liquid 4.0.3
Using pathutil 0.16.2
Using rouge 3.26.0
Using safe_yaml 1.0.5
Using jekyll 3.9.1
Using jekyll-auto-image 1.1.3
Using jekyll-datapage-generator 1.3.0
Using method_source 1.0.0
Using pry 0.14.1
Using rb-readline 0.5.5
Using jekyll-debug 0.0.2
Using jekyll-email-protect 1.1.0
Using jekyll-feed 0.15.1
Using posix-spawn 0.3.15
Using jekyll-last-modified-at 1.3.0
Using redcarpet 3.5.1
Using jekyll-liquify 0.0.2
Using jekyll-mentions 1.6.0
Using jekyll-redirect-from 0.16.0
Using jekyll-seo-tag 2.7.1
Using jekyll-sitemap 1.4.0
Using jekyll-target-blank 2.0.0
Using jekyll-toc 0.17.0
Using json 2.5.1
Using openssl 2.2.0
Using string_inflection 0.1.2
Using uglifier 4.2.0
Using link_header 0.0.8
Using webmention 0.1.6
Using jekyll-webmention_io 3.3.5
Using liquid-c 4.0.0
Using webrick 1.7.0
aarongustafson commented 3 years ago

I kept having Ruby/Jekyll issues when upgrading my Mac, so I have moved off of Jekyll and will not be working on this project anymore, going forward. I am going to flag this as won’t fix, but leave it open in case someone else wants to pick up the project from here.

gryslik commented 3 years ago

I get this exact same error.

fancypantalons commented 3 years ago

So regarding your first stacktrace on Ruby 3.0.1, the only way I can manage to replicate this is by defining a data_dir, and then sticking a CSV file in that directory (the posted backtrace leads to code in Jekyll to read CSV data files as per the Jekyll docs. That is, in my _config.yml setting:

data_dir: data

Then placing a simple CSV file in the data/ directory.

Do you, by any chance, have a data_dir set up with CSV files present in that directory?

fancypantalons commented 3 years ago

Regarding the 2.7.3 error, looking at the code, that looks like a result of the "webmentions" configuration block not being in your _config.yml. Could you post your site configuration when replicating that issue?

xplosionmind commented 3 years ago

Do you, by any chance, have a data_dir set up with CSV files present in that directory?

I have a data directory with several CSVs inside, named _data, as by default. Nevertheless, I added to _config.yml:

data_dir: _data #even though it is useless since it is so by default

Still, it is not working.

xplosionmind commented 3 years ago

Could you post your site configuration when replicating that issue?

Sure, I am using the same configuration always, but I am using Ruby 3.0.2 + Jekyll 4.2.1 (everything latest version) only, now.

My _config.yml:

title: Tommi Space
email: surfing@tommi.space
description: >-
  A virtual representation of the mess inside Tommi’s mind
baseurl: ""
url: "https://tommi.space"
author:
  name: Tommi
  username: tommi
  picture: "/images/profile.jpg"
logo: "/favicon.ico"
publisher: Tommi
timezone: Europe/Rome
github_username: xplosionmind
git_repository: "tommi.space"
future: true
profile: true
livereload: true
strict_front_matter: true
lang: it
locale: it
images: "/images"
post-images: "/images/posts"
image: '/logos/favicon-180.png'
assets: "https://assets.tommi.space/assets"
video: "https://assets.tommi.space/video"
audio: "https://assets.tommi.space/audio"
logos: "/logos"
fonts: "/fonts"
exclude:
  - riordinare/
  - _notes/private/
  - _notes/templates/
  - _notes/.obsidian
  - _notes/.trash
  - _notes/PISE
  - _notes/university
  - _notes/obsidian.css
  - _data/private
  - _notes/.*
  - _data/.*
keep_files:
  - images/
  - assets/
collections:
  poetry:
    output: true
  notes:
    output: true
  filinge:
    output: true
  sconnesso:
    output: true

# Pagination
pagination:
  enabled: true
  sort_reverse: true
  per_page: 6
  title: ':title :num'
  trail: 
    before: 2
    after: 2

feed:
  path: /feeds/zibaldone.xml
  tags:
    path: /feeds/
    only:
      - geek
  collections:
    poetry:
      path: /feeds/poetry.xml
    filinge:
      path: /feeds/filinge.xml
    notes:
      path: /feeds/jam.xml

# SEO
social:
  name: xplosionmind
tagline: "Tommi’s virtual mind"
twitter:
  username: xplosionmind
  card: summary

data_dir: _data

#d3_graph_data:
#  enabled: false

toc:
  list_class: "grey border box"

podcast:
  title: Sconnesso
  description: "Sconnesso è uno pseudo-podcast in cui, per alcuni minuti, racconto ciò che mi sorprende. Sconnesso è sbagliato, ma non scorretto. È atipico, ma non è poi così originale. È curato, ma non studiato alla perfezione. È esasperante, ma mai noioso. È improvvisato, ma non raffazzonato. Non è preparato, ma è attentamente pensato. È confuso e disordinato, ma non complicato. È sconnesso, ma non disconnesso."
  url: "/sconnesso.xml"
  author: "Tommi"
  email: "sono@sconnesso.link"
  link: "https://sconnesso.link"
  logo: "/images/sconnesso.jpg"
  type: "episodic"
  complete: "yes"
  block: "no"

plugins:
  - jekyll-feed
  - jekyll-seo-tag
  - jekyll-sitemap
  - jekyll-last-modified-at
  - jekyll-target-blank
  - jekyll-watch
  - jekyll-redirect-from
  - jekyll-debug
  - jekyll-mentions
  - jekyll-auto-image
  - jekyll-email-protect
  - jekyll-paginate-v2
#  - jekyll-stork
  - jekyll-wikilinks
#  - jekyll-commonmark
#  - jekyll-graph
  - jekyll-webmention_io

sass:
  style: compressed

target-blank:
  rel: external

#markdown: CommonMark # IDs not generated!
#commonmark:
#  options: ["FOOTNOTES", "STRIKETHROUGH_DOUBLE_TILDE", "SMART", "VALIDATE_UTF8", "UNSAFE", "LIBERAL_HTML_TAG", "HARDBREAKS"]
#  extensions: ["strikethrough", "table", "tasklist", "autolink"]

compress_html:
  clippings: all
  comments: all
  endings: all
  startings: all

permalink: /:title

defaults:
  -
    scope:
      path: ""
    values:
      layout: "wrapper"
      lang: "en"
      image: "/images/preview.gif"
      comments: true
      serif: false
      primary: "#FCC920"

  -
    scope:
      path: ""
      type: posts
    values:
      layout: post
      lang: it
      excerpt_separator: "<!--more-->"

  -
    scope:
      path: ""
      type: poetry
    values:
      layout: poetry
      lang: it
      permalink: /:title
      primary: "teal"
      description: "Parole disordinate, fra le nuvole e lo spazio"

  -
    scope:
      path: ""
      type: notes
    values:
      layout: jam
      lang: en
      toc: true
      permalink: /:title
      hide: 0

  -
    scope:
      path: ""
      type: sconnesso
    values:
      layout: sconnesso
      lang: it
      permalink: /sconnesso/:title
      primary: "var(--purple)"
      author: "Tommi"
      categories: "sconnesso"
      episodeType: "full"
      explicit: "no"
      image: "/images/sconnesso.jpg"

  -
    scope:
      path: ""
      type: filinge
    values:
      layout: post
      lang: it
      primary: "#20CE88"
      permalink: /filinge/:title
fancypantalons commented 3 years ago

Do you, by any chance, have a data_dir set up with CSV files present in that directory?

I have a data directory with several CSVs inside, named _data, as by default. Nevertheless, I added to _config.yml:

data_dir: _data #even though it is useless since it is so by default

Still, it is not working.

Yeah, I wouldn't have expected that to fix the issue.

What's strange is I can absolutely replicate this issue, but I cannot resolve it by removing the plugin. i.e. whether the webmention plugin is in my Gemfile or not, if I have a CSV file in my data directory, the issue triggers.

This seems to match what I'm seeing, elsewhere, suggesting this is a Jekyll 3.9 bug due to an incompatibility with Ruby 3.

Digging into the code in Jekyll 3.9.1, we see this code in data_reader.rb:

    def read_data_file(path)
      case File.extname(path).downcase
      when ".csv"
        CSV.read(path, {  <------------ This is the offending callsite that appears in your stacktrace
          :headers  => true, 
          :encoding => site.config["encoding"],
        }).map(&:to_hash)
      when ".tsv"
        CSV.read(path, {
          :col_sep  => "\t",
          :headers  => true,
          :encoding => site.config["encoding"],
        }).map(&:to_hash)
      else
        SafeYAML.load_file(path)
      end
    end

Notice how the calls to CSV.read use a dictionary for optional parameters? From what I can tell, that has been removed in Ruby 3:

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

I verified that this was the issue by modifying the Jekyll code to remove the braces and the issue no longer occurred.

This has since been fixed in Jekyll 4. Unfortunately, this means if you're using Jekyll 3, you're gonna have to stick with Ruby 2.7 if you plan to use CSV data files.

I know that doesn't explain why, in your case, you seem to be able to resolve the issue by removing the gem, but everything I'm seeing suggests this is a Jekyll problem, and makes me wonder if pulling in the gem is causing some mix of constrained versions that's resulting in your ending up with a broken combination (i.e. Jekyll 3.9.1 + Ruby 3.0.2).

fancypantalons commented 3 years ago

Sure, I am using the same configuration always, but I am using Jekyll 3.0.2 only, now.

That's what I thought! I was able to replicate this by setting up the plugin, not specifying a webmentions configuration block in _config.yml and then running jekyll serve. This triggers a bug that I'll resolve shortly.

Meanwhile, as a workaround, specify a webmentions block with a basic configuration and the issue should disappear.

Edit: BTW, thanks for filing #154 separately, which covers this specific issue (and has now been resolved in main).

xplosionmind commented 3 years ago

This seems to match what I'm seeing, elsewhere, suggesting this is a Jekyll 3.9 bug due to an incompatibility with Ruby 3.

I am tremendously sorry. I mistyped what I meant, and I now corrected what I wrote:
I am using Jekyll 4.2.1 with Ruby 3.0.2.

Sorry for my mistake.



That's what I thought! I was able to replicate this by setting up the plugin, not specifying a webmentions configuration block in _config.yml and then running jekyll serve. This triggers a bug that I'll resolve shortly.

Meanwhile, as a workaround, specify a webmentions block with a basic configuration and the issue should disappear.

You mean that adding the plugin to Jekyll and not using it causes an error?
This is funny, but thank you for your help!



BTW, thanks for filing #154 separately, which covers this specific issue (and has now been resolved in main).

No problem! Thank you very much.

fancypantalons commented 3 years ago

So, @xplosionmind , judging by the other issues you've opened, can I assume you've resolved the CSV data file issue? It wasn't clearly to me, from your last comment, where this stood.

xplosionmind commented 3 years ago

This problem appears to have magically vanished.
Thanks a lot.