Skip to content

docs/Gemfile: add irb to silence Ruby 4.0 warning#22428

Merged
MikeMcQuaid merged 1 commit into
mainfrom
docs-gemfile-add-irb
May 27, 2026
Merged

docs/Gemfile: add irb to silence Ruby 4.0 warning#22428
MikeMcQuaid merged 1 commit into
mainfrom
docs-gemfile-add-irb

Conversation

@p-linnane
Copy link
Copy Markdown
Member

YARD's yard/parser/ruby/legacy/irb/slex.rb requires irb/notifier, which triggers a warning under Ruby 4.0 since irb is no longer a default gem:

yard-0.9.43/lib/yard/parser/ruby/legacy/irb/slex.rb:14: warning: irb/notifier is found in irb, which is not part of the default gems since Ruby 4.0.0.
You can add irb to your Gemfile or gemspec to fix this error.

Upstream lsegal/yard#1663 only wraps the require in begin/rescue LoadError, which doesn't help here since irb is in fact installed — Ruby's bundled-gem hook fires the warning before the rescue is relevant. (The actual fix, lsegal/yard#1649, was closed in favor of #1663.)

Declaring irb as an explicit dependency satisfies Ruby's bundled-gem activation check and silences the warning.


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR.

Diagnosed the warning, traced it through bundled_gems.rb to confirm Ruby's hook (not yard itself) is what fires it, and drafted the change with Claude. Verified locally:

$ bundle exec rake yard 2>&1 | grep irb
$ # (no output — warning gone)

Copilot AI review requested due to automatic review settings May 27, 2026 04:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes irb an explicit dependency for the docs bundle to avoid Ruby 4.0 bundled-gem warnings when YARD loads irb/notifier.

Changes:

  • Adds irb to docs/Gemfile.
  • Updates docs/Gemfile.lock with irb and its transitive dependencies.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/Gemfile Declares irb as a docs dependency.
docs/Gemfile.lock Locks irb and related transitive gems for the docs bundle.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/Gemfile
YARD's `yard/parser/ruby/legacy/irb/slex.rb` requires `irb/notifier`,
which triggers a warning under Ruby 4.0 since `irb` is no longer a
default gem. Declare `irb` as an explicit dependency to satisfy the
bundled-gem activation check.
@p-linnane p-linnane force-pushed the docs-gemfile-add-irb branch from 023a801 to 3035d5d Compare May 27, 2026 04:36
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit db57f8b May 27, 2026
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the docs-gemfile-add-irb branch May 27, 2026 08:07
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.

3 participants