Repository navigation
Activate strscan before loading ronn-ng - #9881
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.
rake man:buildcrashes on Ruby 4.0 and 4.1 when thestrscangem is installed next to the default one.bin/ronndies inside kramdown withwrong argument type StringScanner (expected StringScanner), which takesrake bundler:releasedown with it right after the gem is built.Ruby 4.0 stopped registering a requirable path for the
strscandefault gem, soGem.find_default_spec("strscan")returns nil andrequire "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 ownrb_data_type_t. Activatingstrscanup front settles the process on a single copy.With
strscan3.1.8 installed on Ruby 4.0.6,rake man:checkcrashes without this change and passes with it. The 4.0 branch needs the same fix, but itsbin/ronnhas a differentrequire_relativeline, so it goes in as a dedicated PR.Generated with Claude Code