middleman-blog icon indicating copy to clipboard operation
middleman-blog copied to clipboard

YAML error on Ruby 3.1.0

Open mockdeep opened this issue 2 years ago • 6 comments

Expected behaviour

Everything works with no issues.

Actual behaviour

I'm seeing warnings about the date: key when parsing the blog posts:

YAML Exception parsing [PROJECT_PATH]/boon-blog/source/articles/2014-09-23-setting-up-a-middleman-blog.html.md: Tried to load unspecified class: Date

The frontmatter looks like:

---
title: Setting up a Middleman Blog
date: 2014-09-23
tags: technical, blogging, middleman
authors: Robert Fletcher
---

For some reason, the rendered result of this is that the blog posts show up without their titles.

Steps to reproduce the problem

You can run middleman serve on this branch.

Additional information

  • Ruby version: 3.1.0
  • Middleman version: 4.4.2
  • Middleman Blog version: 4.0.3
  • OS version: x86_64-linux

mockdeep avatar Dec 31 '21 20:12 mockdeep

I would recommend keeping Middleman 4.x projects on Ruby 2.x

There are some PRs to enable Ruby 3.1 support, but those are on the Middleman 5.x branch and unlikely to be backported.

tdreyno avatar Jan 01 '22 01:01 tdreyno

@tdreyno I see, do you know when 5.x will be released?

mockdeep avatar Jan 01 '22 02:01 mockdeep

Looking a lot like never, but the master branch is up to date and being updated to current releases just in case.

tdreyno avatar Jan 03 '22 04:01 tdreyno

@tdreyno Should I be making plans to move to a different static site generator?

puyo avatar Apr 06 '22 04:04 puyo

I was able to get around this by adding the time to the date.

lyc4n avatar Jun 22 '22 02:06 lyc4n

There is no reason to be using Ruby 3.x with Middleman. I suggest utilizing rvm or Docker to allow Middleman v4 to continue to operate in the environment it expects.

tdreyno avatar Jun 22 '22 21:06 tdreyno

@mockdeep @puyo @lyc4n We finally pushed some fixes in v4 branch (now "main" branch again) and now it works fine with all these Ruby versions (From 2.5 to 3.3): https://github.com/middleman/middleman/blob/1d1e7528d16dad59a15e988ea5aed171c79a7736/.github/workflows/ci.yml#L12

So I think you can close this issue 🙏🏼

markets avatar Jan 19 '24 23:01 markets