Closed xplosionmind closed 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.
I get this exact same error.
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?
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?
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.
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
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:
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).
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).
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 runningjekyll 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.
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.
This problem appears to have magically vanished.
Thanks a lot.
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:Error with 2.7.3
Again, if I comment out this plugin there are no errors anymore. This is what I get:
Context
For more context, allow me to paste below the content of some other files:
Gemfile
Bundle update
bundle update
output: