`IRB::IrbLoader` aliases of `load`/`require` trigger the alias-fallback deprecation warning on Ruby master

Open Beginner friendly
#1,255 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
ruby
Domain
cli

Research direction

Start with lib/irb/ext/loader.rb at lines 16-17, where the aliases for load and require produce warnings on Ruby master. Reproduce with docker run --rm rubylang/ruby:master ruby -w -e 'require "irb"', then run rake test head. Done means requiring IRB and starting irb emit no alias-fallback deprecation warnings.

Written by the indexing model from the issue text.

Description

Steps to reproduce
docker run --rm rubylang/ruby:master ruby -w -e 'require "irb"'

The same warnings appear when starting irb itself with ruby -w -S irb.

Expected behavior

require "irb" emits no warnings.

Actual behavior
$ ruby -v
ruby 4.1.0dev (2026-09-20T00:17:23Z master 241ea171d1) +PRISM [x86_64-linux]
$ ruby -w -e 'require "irb"'
/usr/local/lib/ruby/gems/4.1.0+4/gems/irb-1.18.0/lib/irb/ext/loader.rb:16: warning: the fallback to Object for alias of 'load' in module 'IRB::IrbLoader' is deprecated and will be removed in Ruby 4.3
/usr/local/lib/ruby/gems/4.1.0+4/gems/irb-1.18.0/lib/irb/ext/loader.rb:17: warning: the fallback to Object for alias of 'require' in module 'IRB::IrbLoader' is deprecated and will be removed in Ruby 4.3

The warnings also appear in this repository's own CI against ruby head, for example in https://github.com/ruby/irb/actions/runs/35449203213/job/105913325835 (rake test head, ruby 4.1.0dev 97207692c2): lib/irb/ext/loader.rb:16 and :17 are reported 48 times across the test processes, although the job still passes because warnings are not turned into errors.

Reference

alias in a module used to fall back to searching Object when the method is defined neither in the module nor in its ancestors. Ruby master now warns about this fallback, and the plan is to warn unconditionally in Ruby 4.2 and to raise NameError in Ruby 4.3, at which point require "irb" would fail.

Dominant language
Ruby
Stars
478
Forks
158
Avg merge
1d 12h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby/irb

All issues in ruby/irb

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.