Skip to content

Activate strscan before loading ronn-ng - #9882

Merged
hsbt merged 1 commit into
4.0from
claude/strscan-ronn-4.0
Sep 16, 2026
Merged

hsbt merged 1 commit into
4.0from
claude/strscan-ronn-4.0

Conversation

@hsbt

@hsbt hsbt commented Sep 16, 2026

Copy link
Copy Markdown
Member

Backport of #9881 to the 4.0 branch. The fix has to be a dedicated PR because bin/ronn still loads ../bundler/spec/support/rubygems_ext here, so a cherry-pick would conflict on every release preparation.

rake bundler:release crashes on Ruby 4.0 right after the gem is built when the strscan gem is installed next to the default one. bin/ronn dies inside kramdown with wrong argument type StringScanner (expected StringScanner), because Ruby 4.0 registers no requirable path for the strscan default gem and the stdlib copy loads without activating a spec, leaving the installed gem free to be activated later and initialize the extension twice.

With strscan 3.1.8 installed on Ruby 4.0.6, rake man:check crashes without this change and passes with it.

Generated with Claude Code

Ruby 4.0 stopped registering a requirable path for the strscan default gem, so `require "strscan"` loads the stdlib copy without activating anything and an installed strscan gem can still be activated later through ronn-ng's dependencies. The extension then gets initialized twice and kramdown dies with `wrong argument type StringScanner (expected StringScanner)`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hsbt
hsbt merged commit 9977c1f into 4.0 Sep 16, 2026
86 checks passed
@hsbt
hsbt deleted the claude/strscan-ronn-4.0 branch September 16, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant