Repository navigation
Conversation
Default gems are always installed with Ruby, so specifying one in `gems:` of rbs_collection.yaml without adding it to Gemfile is valid. Skip the "Cannot find gem. Using incorrect Bundler context?" warning for them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wWXRc7Va2Vqk2G3BbjMWi
- Add `Gem::Specification.default_stubs` to the rubygems shim for Steep - `set` is a default gem on Ruby < 3.5, so the warning is no longer expected there Co-Authored-By: Claude Opus 5.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.
Problem
Once a default gem ships its own
sig/directory, listing that gem undergems:inrbs_collection.yamlwithout adding it to the Gemfile makesrbs collection installprint this warning:The signatures are resolved successfully, and the lockfile records the gem correctly with the
rubygemssource. Default gems are always installed with Ruby, so leaving one out of the Gemfile is a valid configuration, and the warning is misleading.This did not show up before because the signatures of default gems were resolved from the
stdlib/directory bundled with rbs, and gems resolved from stdlib return before the warning check. Whensig/is installed into the gem directory of a default gem, as ruby/ruby#12541 does, the gem is resolved from the Rubygems source instead and reaches the warning about the gem missing from Gemfile.lock.Change
LockfileGeneratornow checks whether a gem missing from Gemfile.lock is a default gem, usingGem::Specification.default_stubsin a new private methoddefault_gem?, and skips the warning if it is.default_stubsreads the gemspec directory of default gems directly, so it is not affected by Bundler replacingGem::Specification.Verification
unundergems:with an empty Gemfile and asserts that the warning is not printed. The test fails without the change.sig/directory into the gem directory of net-http and confirmed that the warning above is printed without the change and not printed with it.🤖 Generated with Claude Code