Bug 1850541 - irb shows error without ruby-default-gems.
Summary: irb shows error without ruby-default-gems.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ruby
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vít Ondruch
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-24 13:23 UTC by Jun Aruga
Modified: 2020-07-02 01:13 UTC (History)
8 users (show)

Fixed In Version: ruby-2.7.1-132.fc33 ruby-2.7.1-132.fc32
Clone Of:
Environment:
Last Closed: 2020-07-02 01:13:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1825251 0 unspecified CLOSED "bundle exec irb" showing "bundler: failed to load command: irb" 2024-11-27 20:59:32 UTC
Ruby 16951 0 None None None 2020-06-24 14:11:44 UTC

Description Jun Aruga 2020-06-24 13:23:50 UTC
Description of problem:

I got the following error with the latest rpms/rubygems (rubygems-3.1.4-200) on Fedora rawhide mock environment, when building rubygem-bson, and running irb on the mock enviornment. I have not checked if it happens with rpms/ruby rubygems.
"reline" in the error message is a default gem of Ruby 2.7.

```
[mockbuild@09a17d56de1f41daaee65b00b45b1482 ~]$ rpm -q ruby rubygems
ruby-2.7.1-131.fc33.x86_64
rubygems-3.1.4-200.fc33.noarch

[mockbuild@09a17d56de1f41daaee65b00b45b1482 ~]$ irb
Traceback (most recent call last):
	8: from /usr/bin/irb:23:in `<main>'
	7: from /usr/share/rubygems/rubygems.rb:297:in `activate_bin_path'
	6: from /usr/share/rubygems/rubygems.rb:297:in `synchronize'
	5: from /usr/share/rubygems/rubygems.rb:298:in `block in activate_bin_path'
	4: from /usr/share/rubygems/rubygems/specification.rb:1371:in `activate'
	3: from /usr/share/rubygems/rubygems/specification.rb:1389:in `activate_dependencies'
	2: from /usr/share/rubygems/rubygems/specification.rb:1389:in `each'
	1: from /usr/share/rubygems/rubygems/specification.rb:1400:in `block in activate_dependencies'
/usr/share/rubygems/rubygems/dependency.rb:311:in `to_specs': Could not find 'reline' (>= 0.0.1) among 15 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/builddir/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
```

After installing `ruby-default-gems`, the error disappeared.

```
$ mock -i ruby-default-gems
```

It is better to add rubygem-default-gems as a requirement of ruby-libs, isn't it?


Version-Release number of selected component (if applicable):
ruby-2.7.1-131.fc33.x86_64
rubygems-3.1.4-200.fc33

How reproducible:


Steps to Reproduce:
1. Build rubygem-bson.spec on Fedora rawhide.
2. Run `mock shell`
3. Run `irb` with a regular user.


Actual results:
The error happens.

Expected results:
The error does not happen.

Additional info:

Comment 1 Vít Ondruch 2020-06-24 14:11:44 UTC
(In reply to Jun Aruga from comment #0)
> It is better to add rubygem-default-gems as a requirement of ruby-libs,
> isn't it?

rubygem-default-gems are installed by default for every Fedora user. Mock is exception, because there are not installed weak dependencies. ruby-libs would be wrong choice anyway, because installed ruby-libs does not mean installed rubygems.

Not sure if I should close this or not, because this is tightly related to bug 1825251. Also, I have recently opened upstream issue which is related: https://bugs.ruby-lang.org/issues/16951

Comment 2 Jun Aruga 2020-06-24 14:56:15 UTC
> rubygem-default-gems are installed by default for every Fedora user. Mock is exception, because there are not installed weak dependencies. ruby-libs would be wrong choice anyway, because installed ruby-libs does not mean installed rubygems.

Sorry for my mistake. I was running the mock with the default mock config (= install_weak_deps=0).

```
DEBUG util.py:623:  Installing weak dependencies:
DEBUG util.py:623:   ruby-default-gems                noarch       2.7.1-131.fc33                 fedora               26 k
DEBUG util.py:623:   rubygem-bundler                  noarch       2.1.4-131.fc33                 fedora              316 k
```

But how ruby-default-gems is installed as weak dependency? Because ruby.spec does not have the logic.
I am okay to close this ticket.
Thanks.

Comment 3 Vít Ondruch 2020-06-24 15:41:48 UTC
(In reply to Jun Aruga from comment #2)
> But how ruby-default-gems is installed as weak dependency? Because ruby.spec
> does not have the logic.

https://src.fedoraproject.org/rpms/ruby/blob/master/f/ruby.spec#_286

It does. Not ideal, but because we have independent rubygems package, it is better IMO, because it allows to keep this dependency on single place and avoids possible different behavior of independent rubygems package comparing to the rubygems subpackage.

Comment 4 Vít Ondruch 2020-06-24 15:44:09 UTC
(In reply to Vít Ondruch from comment #1)
> Also, I have recently opened upstream issue which is related:
> https://bugs.ruby-lang.org/issues/16951

Actually, maybe we should add the ruby-default-gems dependency to IRB referencing the ticket above, that would help to solve this issue and allowed to remove it if possible. Do you mind to open PR?

Comment 5 Jun Aruga 2020-06-24 19:39:50 UTC
> https://src.fedoraproject.org/rpms/ruby/blob/master/f/ruby.spec#_286
> 
> It does. Not ideal, but because we have independent rubygems package, it is better IMO, because it allows to keep this dependency on single place and avoids possible different behavior of independent rubygems package comparing to the rubygems subpackage.


I see. The backward weak dependency is current used [1].

```
%package default-gems
...	
Supplements: ruby(rubygems)
...
```

[1] https://fedoraproject.org/wiki/PackagingDrafts/WeakDependencies#Introduction

> Actually, maybe we should add the ruby-default-gems dependency to IRB referencing the ticket above, that would help to solve this issue and allowed to remove it if possible. Do you mind to open PR?

Sure, I will open it.

Comment 6 Jun Aruga 2020-06-24 21:43:59 UTC
I opened the PR here.
https://src.fedoraproject.org/rpms/ruby/pull-request/65

Comment 7 Fedora Update System 2020-06-26 14:08:06 UTC
FEDORA-2020-b2cf8f17da has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b2cf8f17da

Comment 8 Fedora Update System 2020-06-27 03:12:53 UTC
FEDORA-2020-b2cf8f17da has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b2cf8f17da`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b2cf8f17da

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-07-02 01:13:14 UTC
FEDORA-2020-b2cf8f17da has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.