Repository navigation
Activate strscan before loading ronn-ng - #9882
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #9881 to the 4.0 branch. The fix has to be a dedicated PR because
bin/ronnstill loads../bundler/spec/support/rubygems_exthere, so a cherry-pick would conflict on every release preparation.rake bundler:releasecrashes on Ruby 4.0 right after the gem is built when thestrscangem is installed next to the default one.bin/ronndies inside kramdown withwrong argument type StringScanner (expected StringScanner), because Ruby 4.0 registers no requirable path for thestrscandefault 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
strscan3.1.8 installed on Ruby 4.0.6,rake man:checkcrashes without this change and passes with it.Generated with Claude Code