From: "Eregon (Benoit Daloze) via ruby-core" Date: 2026-03-11T09:56:19+00:00 Subject: [ruby-core:124983] [Ruby Bug#21828] An incorrect warning message related to `benchmark` is shown when using `benchmark-ips` Issue #21828 has been updated by Eregon (Benoit Daloze). A main difference between both reproductions are the Gemfile.lock, for the reproduction in the issue description: ``` GEM remote: https://rubygems.org/ specs: benchmark-ips (2.14.0) PLATFORMS ruby x86_64-linux DEPENDENCIES benchmark-ips CHECKSUMS benchmark-ips (2.14.0) sha256=b72bc8a65d525d5906f8cd94270dccf73452ee3257a32b89fbd6684d3e8a9b1d BUNDLED WITH 4.1.0.dev ``` and for the reproduction from https://bugs.ruby-lang.org/issues/21828#note-6: ``` GEM remote: https://rubygems.org/ specs: drb (2.2.3) minitest (6.0.2) drb (~> 2.0) prism (~> 1.5) prism (1.9.0) rake (13.3.1) PLATFORMS ruby x86_64-linux DEPENDENCIES minitest rake (>= 10.5) CHECKSUMS drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373 minitest (6.0.2) sha256=db6e57956f6ecc6134683b4c87467d6dd792323c7f0eea7b93f66bd284adbc3d prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c BUNDLED WITH 4.0.3 ``` So it seems like the fix only works when there is a dependency on the `benchmark-ips` gem, but there could be `benchmark/something` files outside a gem and then it still warns incorrectly. ---------------------------------------- Bug #21828: An incorrect warning message related to `benchmark` is shown when using `benchmark-ips` https://bugs.ruby-lang.org/issues/21828#change-116673 * Author: y-yagi (Yuji Yaginuma) * Status: Open * Assignee: hsbt (Hiroshi SHIBATA) * ruby -v: ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [x86_64-linux] * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONE ---------------------------------------- ## Descrition When using `benchmark-ips` gem with Ruby 4.0.0, the warning related to `benchmark` gem is shown. ## Step to reproduce ```ruby # Gemfile # frozen_string_literal: true source "https://rubygems.org" gem "benchmark-ips" ``` ```ruby # script.rb require "benchmark/ips" ``` ```text $ bundle exec ruby -v script.rb ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x86_64-linux] script.rb:1: warning: benchmark/ips is found in benchmark, which is not part of the default gems since Ruby 4.0.0. You can add benchmark to your Gemfile or gemspec to fix this error. ``` ## Expected behavior The warning for `benchmark` isn't shown when using `benchmark-ips`. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/