Description of problem: For the binary commands irb, rdoc, ri that are as part of sub packages in ruby.spec (ruby 2.7.1) and that are default gems in the upstream ruby, following error happens, while it does not happen on the upstream ruby 2.7.1 built from the source. In the example, I put `--version` to check the result easily. ``` $ bundle list Gems included by the bundle: * nio4r (2.5.2) Use `bundle info` to print more detailed information about a gem $ bundle exec irb --version bundler: failed to load command: irb (/usr/bin/irb) Gem::Exception: can't find executable irb for gem irb. irb is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:374:in `block in replace_bin_path' /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:402:in `block in replace_bin_path' /usr/bin/irb:23:in `<top (required)>' ``` For follwing commands get same error as well. ``` $ bundle exec rdoc --version $ bundle exec ri --version ``` The reason of the error is `load Gem.activate_bin_path('irb', 'irb', version)` fails in `/usr/bin/{command}` fails when it is called in Bundler and the gem is not a default gem. Bundler checks the gems in the defalt gem or in the `Gemfile` to run the command. Here are the possible solutions. * irb: make irb as bundled default gems in ruby.spec. and if it is necessary, create rubygem-irb to manage `irb` command as a separated RPM too. It's like racc. * rdoc, ri: just ignore this error? Because we have historically declided rdoc as a default gem. Version-Release number of selected component (if applicable): ruby-2.7.1-130.fc33.src.rpm The master latest commit: 26bc2eb795e224b55ef8c217b53f8a75fce744b3 How reproducible: Steps to Reproduce: 1. Run the following command. ``` $ cat > Gemfile <<EOF source "https://rubygems.org" gem "nio4r", "= 2.5.2" EOF ``` 2. Run `bundle install --path=app`. 3. Run following commands. ``` $ bundle exec irb --version $ bundle exec rdoc --version $ bundle exec ri --version ``` Actual results: ``` $ bundle exec irb --version bundler: failed to load command: irb (/usr/bin/irb) Gem::Exception: can't find executable irb for gem irb. irb is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:374:in `block in replace_bin_path' /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:402:in `block in replace_bin_path' /usr/bin/irb:23:in `<top (required)>' $ bundle exec rdoc --version bundler: failed to load command: rdoc (/usr/bin/rdoc) Gem::Exception: can't find executable rdoc for gem rdoc. rdoc is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:374:in `block in replace_bin_path' /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:402:in `block in replace_bin_path' /usr/bin/rdoc:23:in `<top (required)>' $ bundle exec ri --version bundler: failed to load command: ri (/usr/bin/ri) Gem::Exception: can't find executable ri for gem rdoc. rdoc is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:374:in `block in replace_bin_path' /usr/share/gems/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:402:in `block in replace_bin_path' /usr/bin/ri:23:in `<top (required)>' ``` Expected results: ``` $ bundle exec irb --version irb 1.2.3 (2020-02-15) $ bundle exec rdoc --version 6.2.1 $ bundle exec ri --version ri 6.2.1 ``` Additional info:
`bundle exec racc` works on Fedora ruby (the master latest commit: 26bc2eb795e224b55ef8c217b53f8a75fce744b3) with rubygem-racc RPM like this. ``` $ rpm -q ruby rubygem-racc ruby-2.7.1-130.fc33.x86_64 rubygem-racc-1.4.16-201.fc32.x86_64 $ bundle list Gems included by the bundle: * nio4r (2.5.2) Use `bundle info` to print more detailed information about a gem $ bundle exec racc --version racc version 1.4.16 ```
@Jun, is there a chance that something got improved with ruby-2.7.1-132.fc33?
> @Jun, is there a chance that something got improved with ruby-2.7.1-132.fc33? I have not test the "Steps to Reproduce" on ruby-2.7.1-132.fc33. But I do not think something got improved. Because irb and rdoc is still not default gem.
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle. Changing version to 33.
I ran into what I believe is this same issue. I am trying to update rubygem-tins to latest version after it has been neglected for a long time. Its test suite is failing due to errors of following kind: > LoadError: failed to load <LONG_PATH_HERE/method_description_test.rb>: cannot load such file -- irb It is not a surprise that the gemspec does not list irb as a dependency, it is a Ruby default gem after all. The issue is easily fixed by adding these two lines to specfile: > Requires: rubygem(irb) > BuildRequires: rubygem(irb) I am not sure if there is any bug here. If it is a Fedora decision to modify the list of default gems the naturally we cannot expect to get upstream gemspecs that would match Fedora's list of default gems and these situations have to be resolved manually. But since this bug is still open, perhaps there is something here that I have not grasped yet?
> I am not sure if there is any bug here. Otto, in our past intention or context, the rpms/ruby main package doesn't require the rubygem-irb sub package intentionally to minimize the size of the main RPM package, and to give users options to install rubygem-irb or not. > > Requires: rubygem(irb) > > BuildRequires: rubygem(irb) https://src.fedoraproject.org/rpms/rubygem-tins/c/fbf3d6455957b40bcc3810765fccf87a64e4f9f1?branch=rawhide I think your solution is basically right. Though in this case, the irb is required in a file under lib that means it is used in a specific case, but not written on the upstream tins.gemspec file. So, in the current way, the `Requires: rubygem(irb)` is not really required to minimize the installed RPM size. (It's up to you). https://github.com/flori/tins/blob/master/lib/tins/xt/irb.rb#L1 > But since this bug is still open, > perhaps there is something here > that I have not grasped yet? When searching past commits by the keyword "StdLib" in rpms/ruby rawhide branch, you can find some commits to move a rubygem-* sub-package in rpms/ruby to StdLib (default gems). * Bundle OpenSSL into StdLib. * Bundle did_you_mean into StdLib. * Bundle Racc into StdLib. We had to do it to fix some issues. So, as a solution of this issue, the rubygem-irb can be also moved to StdLib (default gems). https://src.fedoraproject.org/rpms/ruby/commits/rawhide
Thank you for explaining this, Jun. I do not think it is entirely up to me how to declare this in rubygem-tins. If the general Fedora Ruby stack tries to minimize runtime dependency footprint, it is not acceptable for maintainers of individual libraries to break that by declaring additional Requires. So, tins only pulls in the irb dependency if 'tins/xt/irb' is required. That only makes sense if 'irb' is required anyhow, so according to Fedora definition of what is included in the default gems, rubygem-irb should be required in any case. For any other use of tins, irb is not required. Based on this, I will remove the Requires: rubygem(irb) from rubygem-tins and let users declare that as needed. There is a special case of doing 'require 'tins/xt', which pulls in *all* 'xt's, but such import-everything is something that should be fixed upstream.
This message is a reminder that Fedora 33 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '33'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 33 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
I can confirm this is still an error in F35.
This message is a reminder that Fedora Linux 35 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '35'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 35 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
I can comfirm this error still happens on Fedora rawhide. ``` <mock-chroot> sh-5.2$ rpm -q ruby ruby-3.1.3-172.fc38.x86_64 <mock-chroot> sh-5.2$ rpm -q rubygem-bundler rubygem-bundler-2.3.7-171.fc38.noarch <mock-chroot> sh-5.2$ rpm -q rubygems rubygems-3.3.26-172.fc38.noarch <mock-chroot> sh-5.2$ cat > Gemfile <<EOF source "https://rubygems.org" gem "nio4r", "= 2.5.2" EOF <mock-chroot> sh-5.2$ bundle install --path=app <mock-chroot> sh-5.2$ bundle exec irb --version bundler: failed to load command: irb (/usr/bin/irb) /usr/share/gems/gems/bundler-2.3.7/lib/bundler/rubygems_integration.rb:319:in `block in replace_bin_path': can't find executable irb for gem irb. irb is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/rubygems_integration.rb:347:in `block in replace_bin_path' from /usr/bin/irb:25:in `<top (required)>' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `load' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `kernel_load' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in `run' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in `exec' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in `dispatch' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in `start' from /usr/share/gems/gems/bundler-2.3.7/libexec/bundle:48:in `block in <top (required)>' from /usr/share/gems/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors' from /usr/share/gems/gems/bundler-2.3.7/libexec/bundle:36:in `<top (required)>' from /usr/bin/bundle:25:in `load' from /usr/bin/bundle:25:in `<main>' ```
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38.
I don't see any changes about the IRB about this issue. Change the version to rawhide again.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle. Changing version to 39.