Pacman update conflict with ruby default gem

I have an update that’s not going through.

looking for conflicting packages...

Packages (1) ruby-bundler-2.7.2-1

Total Installed Size:  1.66 MiB
Net Upgrade Size:      0.01 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                    [--------------------------------------------------------------------] 100%
(1/1) checking package integrity                                                                                  [--------------------------------------------------------------------] 100%
(1/1) loading package files                                                                                       [--------------------------------------------------------------------] 100%
(1/1) checking for file conflicts                                                                                 [--------------------------------------------------------------------] 100%
error: failed to commit transaction (conflicting files)
ruby-bundler: /usr/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/exe/bundle exists in filesystem
ruby-bundler: /usr/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/exe/bundler exists in filesystem
ruby-bundler: /usr/lib/ruby/gems/3.4.0/specifications/default/bundler-2.7.2.gemspec exists in filesystem
Errors occurred, no packages were upgraded.

I suspect that some system-wide installed gem has brought in this version of ruby-bundler and I do remember trying to get ASCIIdoctor’s PDF support to work on this machine recently, which might have done this. Anyway, I’d like to fix this, but would have to remove a default gem. I found some sources explaining how to do it, but also some others making it seem like something one should not do. What’s the right way to go about this? I have considered removing ruby and all dependencies, but that also didn’t look like a good option…

What command did you use?

The error is telling you the same version of ruby-bundler that you are trying to install, is already installed.

You could always use the Big Hammer™:point_down:

sudo pacman -Syu ruby-bundler --overwrite="/usr/lib/ruby/gems/*"
2 Likes

just
sudo pacman -Syyu
after previously running
sudo pacman -Syyu --ignore ruby-bundler

I appreciate the suggestion, but it does seem to set me up for problems later on at a time when I will have forgotten about doing this, or will it not?

That doesn’t look like output from an update, unless that’s the only package to be updated. If it was installed by gem then it shouldn’t show up as a repo package to be updated.

It looks more like you’re installing it.

:man_shrugging:


It’s saying that nothing currently installed in the system is meant to own those files, the package to be installed owns them, yet they already exist.

Check if it’s installed with gem, if it is then you can uninstall it using gem and reinstall it using the package manager. If not then --overwrite should be fine.

3 Likes

Abandoned topic (60+ days)