Skip to content

Conversation

@mmenanno
Copy link
Contributor

@mmenanno mmenanno commented Dec 19, 2025

Summary

Upgrades Ruby and dependencies to address upcoming EOL and resolve build issues with modern Ruby versions.

Changes

Ruby & Bundler

Gem Updates

  • Haml: Upgraded to 7.1 (the monkey patch issue that previously blocked this has been resolved)
  • Haml: Upgraded to 6.4 until this PR to middleman gets merged
  • middleman-core: I had to set this to a git commit until they cut a new version, otherwise it forces a very old bundler version to be used
  • General: Updated all gems to latest compatible versions

Build Fixes

Sass Deprecation

  • Replaced deprecated sass gem with sassc
  • Ruby Sass has reached end-of-life and should no longer be used
SCR-20251219-jncx

Markdown Renderer

Replaced Redcarpet with Kramdown to fix undefined method 'link_to' for nil error. This is a known Middleman issue with Ruby 3.x where the Redcarpet renderer context is nil.

Config changes:

# Before (Redcarpet)
set :markdown_engine, :redcarpet
set :markdown,
    fenced_code_blocks: true,
    smartypants: true,
    disable_indented_code_blocks: true,
    prettify: true,
    strikethrough: true,
    tables: true,
    with_toc_data: true,
    no_intra_emphasis: true,
    renderer: UniqueHeadCounter

# After (Kramdown)
set :markdown_engine, :kramdown
set :markdown,
    input: 'GFM',
    auto_ids: true,
    hard_wrap: false,
    smart_quotes: ['lsquo', 'rsquo', 'ldquo', 'rdquo'],
    syntax_highlighter: :rouge,
    syntax_highlighter_opts: { guess_lang: true }
Redcarpet Feature Kramdown Equivalent
fenced_code_blocks, tables, strikethrough, no_intra_emphasis input: 'GFM' (GitHub Flavored Markdown)
smartypants smart_quotes
with_toc_data auto_ids: true
UniqueHeadCounter renderer Built-in (Kramdown auto-generates unique header IDs)
disable_indented_code_blocks Not needed (all code uses fenced blocks)
prettify Not needed (using Rouge syntax highlighter)

Removed unused files:

  • lib/unique_head.rb - Custom Redcarpet renderer for unique header IDs (Kramdown handles this natively)
  • lib/multilang.rb - Redcarpet extension that wasn't being used

JavaScript Minification

  • Enabled Uglifier harmony mode to support ES6 syntax (const, let, arrow functions)

Not Updated

  • middleman-sprockets: Remains pinned to 4.1.0 - verified that #2302 still affects 4.1.1 (autoprefixer sees SCSS // comments before compilation)

@mmenanno mmenanno changed the title Dependancy Upgrades Upgrade Ruby to 3.4 and fix build compatibility issues Dec 19, 2025
@mmenanno mmenanno force-pushed the dependancy-upgrade branch 3 times, most recently from 4d7b65d to 2f5b55f Compare December 19, 2025 17:18
@jpjpjp
Copy link
Collaborator

jpjpjp commented Dec 24, 2025

Hi @mmenanno. Thank you for doing this! This PR is listed as a draft. Is it ready to be merged?

@mmenanno
Copy link
Contributor Author

@jpjpjp I kept it in draft since the next major Ruby version comes out tomorrow on Christmas, so I figured once that is out I'll update this PR to use that so that we will maximize how much time we have till approaching EOL of a version again.

@jpjpjp
Copy link
Collaborator

jpjpjp commented Jan 26, 2026

Hi @mmenanno, just wanted to ask if you can rebase if you do decide to push a version with the latest Ruby.

- Upgrade Ruby from 3.2 to 3.4 (3.2 EOL in ~3 months)
- Update Bundler and gems to latest versions
- Upgrade Haml to 7.1 (blocking issue now resolved)
- Replace deprecated sass gem with sassc
- Replace Redcarpet with Kramdown to fix link_to nil error on Ruby 3.x
- Enable Uglifier harmony mode for ES6 syntax support
- Remove unused lib/unique_head.rb and lib/multilang.rb

Closes middleman/middleman#2818 workaround via Kramdown migration
@mmenanno mmenanno changed the title Upgrade Ruby to 3.4 and fix build compatibility issues Upgrade Ruby to 4.0 and fix build compatibility issues Jan 26, 2026
@mmenanno
Copy link
Contributor Author

@jpjpjp I've rebased it and updated to the latest ruby version in here. That being said I've tried both 4.0.0 and 4.0.1 and netlify is failing to initialize the repo with

5:19:38 PM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
5:19:38 PM: Unknown ruby interpreter version (do not know how to handle): 4.0.1.
5:19:38 PM: Attempting Ruby version 4.0.1, read from .ruby-version file
5:19:38 PM: Unknown ruby interpreter version (do not know how to handle): 4.0.1.
5:19:38 PM: Failed to install Ruby version '4.0.1'
5:19:38 PM: Failing build: Failed to install dependencies

I'm a little confused by this because the netlify docs say that it should support any version:

Both methods above will accept any released version of Ruby, or any valid string that RVM understands.

I'm not sure why it isn't picking up the latest version. That being said the docs reverence RVM, and the logs seem to reference mise. Do we have any special configs in our build? Even mise should be able to resolve it though, that is how I manage my ruby locally myself.

@jpjpjp
Copy link
Collaborator

jpjpjp commented Jan 28, 2026

I'm not sure why it isn't picking up the latest version. That being said the docs reverence RVM, and the logs seem to reference mise. Do we have any special configs in our build? Even mise should be able to resolve it though, that is how I manage my ruby locally myself.

Hmm. According to https://docs.netlify.com/build/configure-builds/available-software-at-build-time/, it looks like Netlify only supports Ruby 3.x

@mmenanno
Copy link
Contributor Author

Hmm. According to https://docs.netlify.com/build/configure-builds/available-software-at-build-time/, it looks like Netlify only supports Ruby 3.x

The default is 3.x but the available versions on that page is listed as "Any official Ruby version" which includes 4.x 🤔

@jpjpjp
Copy link
Collaborator

jpjpjp commented Jan 29, 2026

Hmm. According to https://docs.netlify.com/build/configure-builds/available-software-at-build-time/, it looks like Netlify only supports Ruby 3.x

The default is 3.x but the available versions on that page is listed as "Any official Ruby version" which includes 4.x 🤔

I can't help thinking that the simplest fix would be to upgrade to 3.4 instead of 4.x. That way we avoid any 3.2 end of life issues. Our longer-term plan is to eventually deprecate the v1 API and move the legacy docs somewhere under the new v2 API docs: https://alpha.lunchmoney.dev/v2/docs.

Net/Net we don't need a solution that is multi-year future proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants