Skip to content

Activate strscan before loading ronn-ng - #9881

Merged
hsbt merged 1 commit into
masterfrom
claude/strscan-warning-error-a6d27b
Sep 16, 2026
Merged

hsbt merged 1 commit into
masterfrom
claude/strscan-warning-error-a6d27b

Conversation

@hsbt

@hsbt hsbt commented Sep 16, 2026

Copy link
Copy Markdown
Member

rake man:build crashes on Ruby 4.0 and 4.1 when the strscan gem is installed next to the default one. bin/ronn dies inside kramdown with wrong argument type StringScanner (expected StringScanner), which takes rake bundler:release down with it right after the gem is built.

Ruby 4.0 stopped registering a requirable path for the strscan default gem, so Gem.find_default_spec("strscan") returns nil and require "strscan" loads the stdlib copy without activating a spec. The installed gem is then activated later through ronn-ng's dependencies and the extension is initialized a second time with its own rb_data_type_t. Activating strscan up front settles the process on a single copy.

With strscan 3.1.8 installed on Ruby 4.0.6, rake man:check crashes without this change and passes with it. The 4.0 branch needs the same fix, but its bin/ronn has a different require_relative line, so it goes in as a dedicated PR.

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 55428e8 into master Sep 16, 2026
110 checks passed
@hsbt
hsbt deleted the claude/strscan-warning-error-a6d27b branch September 16, 2026 07:47
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.

1 participant