$ gem update --system ---- returns "undefined method `source_paths'"

Ugh, so literally had thought I had cleared up my problem with install ruby on rails but now I’m running into issues with

gem install rails

and

gem update --system

Attached is a screenshot of what the commands return. I’ve been stuck on this problem for awhile now. I’ve tried uninstalling both ruby and rails, I’ve also tried just deleting the executables ruby and rails from /usr/bin in addition to the ruby-mri gem.

todays_problem

Any suggestions for how to move forward? End goal is to just get Ruby on Rails re-installed.

Kendra

update: just tried this command gem install bundler as suggested in this post: ruby - Why does 'gem install bundler' throw "NoMethodError undefined method `size' for nil:NilClass"? - Stack Overflow (went here because it was related to gem update --system) and this is the output received:
problem_solveattempt1

So, ideally one should not mix system installed packages (ones installed from the repositories) and ones installed from various forges. One should also not delete files from these packages by hand. rpm (via dnf) manages them, and users should use these tools only.

To update gem, which is /usr/bin/gem and is a system installed file, when you run gem update --system, you probably need to run it using sudo. I would STRONGLY advise against doing so. If at all possible, we should check if the rpm packages in the repository provide a newer version.

So, could we have some more information please?

  • What version of Fedora is this?
  • What is the output of:
rpm -qf /usr/bin/gem
rpm -qi rubygems

Huh, okay. I didn’t know that. I had a feeling that manually deleting these packages by hand was probably the wrong way to go about it but wasn’t sure. Thank you for the confirmation :slight_smile:

Ah, well okay. I just checked my command history and I have ran gem update --system several times but only once with sudo :grimacing:. The specific command ran was sudo gem update --system 2.0.3

Okay, so I’ve gathered the information you requested. I dumped it all into one screenshot. Also, I appreciate your help! Thank you!
may21_output_results

Ah, so part of the problem is that you are running Fedora 26. Fedora 26 reached its End of Life (EOL) quite a while ago and does not receive updates any more. It is why you are not receiving the latest version of ruby.

https://apps.fedoraproject.org/packages/ruby/updates/

I would strongy recommend you to update to a current release—F30 just released a week or so ago and Fedora 28 reached EOL. That will ensure you get the latest versions of software.

1 Like

Okay. I’ll have to ask if I can do so since all of us at my company are running on Fedora 26.

If I am not allowed to update to the current release, do you know of any work arounds? Or am I just out of luck?

That’s not a wise decision really—Fedora 26 being EOL also implies that it will no longer receive security updates. If you are looking for a slower moving system to user for work, one of the Fedora downstreams, like CentOS, would be suggested. Each Fedora release only lives for 13 months and them must be upgraded for the next one.

You’ll have to find other ways of installing these tools since you will no longer be able to rely on the Fedora repositories. sudo gem update --system etc. will be the only way. You’ll have to keep track of what you’re installing etc. yourself, though, since rpm/dnf will not be able to track these.

1 Like

Alright, thank you for your insight/knowledge. I’ll see what I can do.

1 Like

Hey!! So I got permission to upgrade my system to Fedora 30. I am following this guide: DNF System Upgrade :: Fedora Docs and I am currently on step 4.

I just ran this command
sudo dnf system-upgrade download --refresh --releasever=30
and obtained the following output - which I’m not really sure how to go about “fixing” - How do I proceed?
may21_afternoonProb

I see that the last line says to add --allowerasing to replace conflicting packages or --skip-broken to skip uninstalled packages but if I do any of these options, will this come back to bite me later on?

According to this post: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/
I will need to re-run the command sudo dnf system-upgrade download --refresh --releasever=30 with --allowerasing – and thus I will proceed as so.

and now I see that step 5 told me what to do the whole time. Sorry for wasting your time! :grimacing:

1 Like

Upgrading from F26 to F30 may or may not work. Fedora changes quite a bit in 4 releases. I’d keep a backup and a F30 USB stick ready, just in case. All the best :crossed_fingers:

1 Like

Oh dear. Okay, I just ran through what step 5 did and now I am seeing this error. may21_1520

Does this mean I need to run this command:
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-32-primary ?

but with 30 instead of 32?

But then again I’m not trying to upgrade to “Rawhide” so that’s probably not the command I should use.

At this point, I’m not really sure if I should just ignore the warning and proceed forward or if I should try and “fix” the warning and then proceed forward. However, if I were to “fix” the warning, I am not sure what the next step should be.

Fedora 26 doesn’t have the keys for Fedora 30, because they never existed at the same time. Generally, the only supported upgrade path is N+1 or N+2. So if possible, it might be easier to upgrade to 26->27->28->29->30 individually or 26->28->30, though unfortunately it will be a bit slower.

2 Likes

Okay, I updated from 26->28->30 and the update worked just fine. Thank you for your help!

4 Likes