Rubygems: warning: constant Gem::ConfigMap is deprecated

Created on 4 Jan 2020  路  60Comments  路  Source: rubygems/rubygems

I'm having a problem

My current problem is I'm running the latest version of ruby gems and I'm seeing deprecation warnings:

$ gem update --system
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
Latest version already installed. Done.

This issue is related to:

  • [X] Other

Here are my current environment details:

$ gem env version
$ gem env version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
3.1.2

$ ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu]

I will abide by the code of conduct

feedback required

Most helpful comment

A quick tip for anyone finding this issue before a newer version fixes things: I got rid of the warnings by downgrading to the latest RubyGems that doesn't have the deprecation warning:

gem update --system 3.0.6

I did this on Ubuntu 18.04 and it worked nicely. Another option may be to set the env variable DEBIAN_DISABLE_RUBYGEMS_INTEGRATION (to any value), which disables the problematic library that gets autoloaded, but for me that caused issues with some installed gems.

All 60 comments

I have exactly the same issue.

$ gem --version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
3.1.2

Can you tell us more information about your ruby installation? Does the /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb file belong to an OS package?

You can easily replicate it with the following Dockerfile:

FROM ubuntu:18.04
RUN apt update && apt install -y  ruby-dev
RUN gem update --system

Hopefully, it provides you with all details necessary.

It鈥檚 the distribution issue, especially debian.

It sounds like this is fixed in rubygems-integration deb package version 1.13.0: https://salsa.debian.org/ruby-team/rubygems-integration/blob/19f2071a0f6e40ac04cdeae7fbcb14880aa24bf6/debian/changelog#L24. But in ubuntu only version 1.11.0 is shipped.

Maybe we should only ship this kind of deprecations on new rubies, so that distributions can update this at their own pace?

We couldn't control the patches on the Linux distributions. Because they will backport patches across Ruby versions.

same issue on ubuntu 18.04

 gem env version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/all/specifications/net-http-persistent-2.9.4.gemspec:20.
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
3.1.2

We couldn't control the patches on the Linux distributions. Because they will backport patches across Ruby versions.

Yeah, I mostly agree, but maybe deprecating things only on the newest ruby could be a good compromise between allowing us to move forward and deprecate things, but still avoid these kind of OS packaging issues, because when the new ruby gets shipped as a new OS package, deprecations will be fixed on it without the need for backports to older rubies.

I'll try raise an issue at https://salsa.debian.org/ruby-team/rubygems-integration to try get feedback about this and figure out the best way to do things.

In the mean time, the workaround (or maybe final "fix" depending on what conclusions we reach) is: never upgrade rubygems through gem update --system on an OS packaged ruby. Instead, always do it through the OS package manager (apt-get install or whatever).

I'll try raise an issue at https://salsa.debian.org/ruby-team/rubygems-integration to try get feedback about this and figure out the best way to do things.

馃憤

never upgrade rubygems through gem update --system on an OS packaged ruby. Instead, always do it through the OS package manager (apt-get install or whatever).

Completely agreed. If we will support the upgrading the rubygems provided by the operating system., We should test them with CI.

This probably doesn't help now you've identified the issue, but FWIW this is on Mint 19.1 after doing a
gem update --system
yesterday

$ gem --version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /var/lib/gems/2.5.0/specifications/activerecord-spatialite-adapter-0.4.1.gemspec:18.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /var/lib/gems/2.5.0/specifications/rgeo-activerecord-0.4.6.gemspec:18.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /var/lib/gems/2.5.0/specifications/sqlite3-ruby-1.3.3.gemspec:20.
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
3.1.2

we're seeing this issue as well, but only with

bundle exec gem --version

Going through the logs to see if there have been any recent updates.

Rubygems 3.1.1
Ruby 2.5.5
Bundler 2.0.2

I created a thread in debian mailing lists to ask about this: https://lists.debian.org/debian-ruby/2020/01/msg00015.html.

Also, if I may ask the people getting this issue. Why are you upgrading rubygems?

Regarding my previous question, let me clarify. Is it because of some instructions or documentation you read somewhere, or is it just because you wanted to pick up some bug fix or feature, or simply run the latest version?

I'm asking because maybe we should clarify such documentation if it exists.

@deivid-rodriguez I was having a problem which unfortunately I can't remember the detail of now, and a suggestion on stack exchange was to try running the update.

Have since switched to rbenv and not looking back. I'm surprised one of the ruby version managers isn't distributed by default in the distros.

I'm having this problem just by running ruby. I just udated Rubygems and it started happening.

~ # ruby
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated

~ # ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

I got a reply from debian packagers, see https://lists.debian.org/debian-ruby/2020/01/msg00025.html.

To summarize:

  • They consider moving the updated rubygems-integration package to the stable repositories so users can pick it up.
  • They consider splitting out a separated rubygems deb package, so rubygems can be upgraded separately from ruby through the OS package manager.
  • They would be happy if we deprecated things only on new rubies, so they have time to prepare packages with fixed deprecations and old users don't get them.

I think deprecating things only on newest rubies is a good compromise, and it also gives us a clear deprecation horizon. We can fully remove the deprecated code once we drop support for the ruby version where the deprecation is first being printed. I think it should be easy to implement, what do you think @hsbt?

A quick tip for anyone finding this issue before a newer version fixes things: I got rid of the warnings by downgrading to the latest RubyGems that doesn't have the deprecation warning:

gem update --system 3.0.6

I did this on Ubuntu 18.04 and it worked nicely. Another option may be to set the env variable DEBIAN_DISABLE_RUBYGEMS_INTEGRATION (to any value), which disables the problematic library that gets autoloaded, but for me that caused issues with some installed gems.

Also, if I may ask the people getting this issue. Why are you upgrading rubygems?

Bundler asked me to do this.

Regarding my previous question, let me clarify. Is it because of some instructions or documentation you read somewhere, or is it just because you wanted to pick up some bug fix or feature, or simply run the latest version?

I'm asking because maybe we should clarify such documentation if it exists.

@deivid-rodriguez
I never update bundler unless forced: this time it was after installation of ruby-all-dev=1:2.5.1 in a ubuntu:18.04 container:

RUN gem update --system  # NOTE this nonsense is required for this version apparently
RUN gem install bundler -v '~> 2.0'

It's perfectly fine to upgrade rubygems, we're actually very happy that people use the latest version and pickup our bugfixes and new features. The problem is that if for some reason you're using ruby through OS packages, you shouldn't upgrade rubygems through gem update --system. So if some instructions or Dockerfile out there do things like

RUN apt install ruby
RUN gem update --system

we should fix it.

OK, my problem has turned to be another bundler-Gemfile.lock quirk (which I "workarounded" with the superfluous gem update --system and which my fair experience failed to help me understand), and though I don't entirely understand a possible cause for the warning (looks like some deps inconsistency), my issue is closed at the moment.

Also, if I may ask the people getting this issue. Why are you upgrading rubygems?

The bundler asked me to upgrade rubygems.

I got rid of the warnings by downgrading to the latest RubyGems that doesn't have the deprecation warning

I did the same thing here on Ubuntu 18.04 and it's fixed.

I encountered this issue whilst following the instructions for installing "Staytus" here:
https://atech.blog/atech/install-staytus-tutorial
It works, but with warnings about "constant Gem::ConfigMap is deprecated".

Same issue here, Ubuntu 19.10
Is using rvm can help avoid those distrib specific problems ?

++ Same here

Same issue here, Ubuntu 19.10
Is using rvm can help avoid those distrib specific problems ?

I dont now about RVM but I fix in ubuntu 19.10 runnig :
sudo gem update --system 3.0.6

@FabioRNobrega : Thanks for this. This worked for me. Foreman 1.24.2 (https://theforeman.org) which had the same type of message on Debian 10 (buster)..

smart-proxy[25744]: /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated

The command

sudo gem update --system 3.0.6

fixed the problem.

I am using Ruby on Ubuntu and I installed it through the OS packages with apt install ruby-full.
I've then executed gem update --system, which is giving me the error reported in this issue.

As you said this could probably be fixed with gem update --system 3.0.6 but I read in a comment above that I shouldn't have ran "gem update --system" in the first place if I installed Ruby through OS packages.

So do you think I should revert the situation to how it was before updating rubygems? If so, could you please advice on how to do so?
Thanks a lot!

So, the issue is (as far as I have seen):

  • The system install of rubygems on some Debian/Ubuntu distro versions has the bug that causes Cant find gem bundler (>= 0.a) with executable bundle
  • One of the suggested solutions for that issue is to upgrade the system rubygems with gem update --system
  • Doing that used to work fine, but now causes deprecation warnings to be spewed from every ruby application.

Having it too, with a fullstaq-ruby apt package (2.6.5), after doing:

gem update --system
gem install bundler -v "~> 1.0"

The warning, with the issue in bundler:

/usr/lib/fullstaq-ruby/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated

There is no ruby packaging issue in this case.

# gem -v
3.1.2

@maximeg In your case the warning comes from using a very old bundler with a very new rubygems. You should upgrade bundler and that should fix the issue.

At https://bundler.io/guides/bundler_2_upgrade.html#prerequisites, we are instructed to run:

gem update --system

but @deivid-rodriguez here says

if for some reason you're using ruby through OS packages, you shouldn't upgrade rubygems through gem update --system

As far as I can see, Bundler 2 should not be used if you are using rubygems 2 installed as part of your OS (e.g. on Ubuntu 18.04). Why? because to use bundler 2, you have to do something (gem update --system) that you should not do.

I think the bundler 2 documentation needs to spell this out.

Thanks @rennex https://github.com/rubygems/rubygems/issues/3068#issuecomment-574775885 , it worked i was having the same issue in msfconsole

What about to provide way to add warning to gem update --system when maintained by system?

Many people suggest downgrading to 3.0.6 but while it's a genuine advise that fixes the issue, it's a bit dated. Please take a look at the current available versions and then downgrade to the latest 3.0 version.

As of writing, the current version 3.0 is 3.0.8 and not 3.0.6 (released August 16, 2019).

gem update --system 3.0.8 - released February 18, 2020

just delete the file "/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system"

step1 : rm -r /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system
step2 : #go to the gemfile location
step3: bundle install

it works for me

It works

gem update --system

gem update --system 3.0.6

gem -v

3.0.6

@hruday007 as I said in https://github.com/rubygems/rubygems/issues/3068#issuecomment-633071612, please never ever write 3.0.6 ever again! It is currently 3.0.8. You can find the current latest 3.0.x version at https://rubygems.org/gems/rubygems-update/versions.

Please do not get people to downgrade to older software than they have to

A quick tip for anyone finding this issue before a newer version fixes things: I got rid of the warnings by downgrading to the latest RubyGems that doesn't have the deprecation warning:

gem update --system 3.0.6

I did this on Ubuntu 18.04 and it worked nicely. Another option may be to set the env variable DEBIAN_DISABLE_RUBYGEMS_INTEGRATION (to any value), which disables the problematic library that gets autoloaded, but for me that caused issues with some installed gems.

I'm about to cry, thank you, If I was millionaire I swear I would send you a ferrari.

root@kali:~/Desktop/box/tartarsauce# wpscan -h Traceback (most recent call last): 10: from /usr/bin/wpscan:23:in

'
9: from /usr/local/lib/site_ruby/2.7.0/rubygems.rb:304:in activate_bin_path' 8: from /usr/local/lib/site_ruby/2.7.0/rubygems.rb:304:insynchronize'
7: from /usr/local/lib/site_ruby/2.7.0/rubygems.rb:306:in block in activate_bin_path' 6: from /usr/local/lib/site_ruby/2.7.0/rubygems.rb:243:infinish_resolve'
5: from /usr/local/lib/site_ruby/2.7.0/rubygems/request_set.rb:435:in resolve_current' 4: from /usr/local/lib/site_ruby/2.7.0/rubygems/request_set.rb:435:innew'
3: from /usr/local/lib/site_ruby/2.7.0/rubygems/resolver/set.rb:24:in initialize' 2: from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:42:inrequire'
1: from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_gem.rb:67:in gem' /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_gem.rb:67:insynchronize': deadlock; recursive locking (ThreadError)
`

Please help me. Fix RubyGems. I used gem update --system 3.0.6

Hi @lavie3k! I'm sorry people are still having this issue. In your case, you're running into a separate issue that was fixed in rubygems 3.1, so the gem update --system 3.0.6 won't do the trick for you. Another option is to pick up rubygems-integration from unstable which already includes the fixes needed to fix this warning.

@lavie3k does gem update --system 3.0.8 help you?
As I have said before in https://github.com/rubygems/rubygems/issues/3068#issuecomment-633071612 and https://github.com/rubygems/rubygems/issues/3068#issuecomment-642106276 - there is no reason to use 3.0.6. The last 3.0.x version i 3.0.8.

EDIT: sorry didn't read https://github.com/rubygems/rubygems/issues/3068#issuecomment-658041959 closely enough. You apparently need version 3.1.x Or update your linux distro to a newer release.

I have same problem, but in different circumstances.

Using Ubuntu 18.04 and Ruby 2.7.1 (image from https://www.brightbox.com/docs/ruby/ubuntu/) the first time this error appeared when running -

RUN gem install bundler -v 1.17.3
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated

Afterwards I updated bundler to 2.1.4, tried gem update --system (resolved to 3.1.4), gem update --system 3.0.6, gem update --system 3.0.8 and gem update --system 3.2.0.rc.1. Nothing has changed, and the deprecation warning was shown also after running:

RUN gem update --system <any version>

On versions 3.0.6 and 3.0.8 I also got some more warnings and errors (I guess related to using Ruby 2.7.1).

I was hoping I can switch to Ruby 2.7 still on Ubuntu 18.04.

EDIT: Using DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=true works for now (at least I can build an image without any warnings). Thanks for all the hints.

I'm guessing ubuntu also needs to fix the warnings, but I have no idea where ubuntu manages its package sources.

it seems it will be backported from debian at some point - https://git.launchpad.net/ubuntu/+source/rubygems-integration/log/

I'm guessing ubuntu also needs to fix the warnings, but I have no idea where ubuntu manages its package sources.

Yep. It is Ruby 2.7.0.
:( Please help me. Because if I start Wpscan or Evil-winrm ... it is error :(((

I have same problem, but in different circumstances.

Using Ubuntu 18.04 and Ruby 2.7.1 (image from https://www.brightbox.com/docs/ruby/ubuntu/) the first time this error appeared when running -

RUN gem install bundler -v 1.17.3
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated

Afterwards I updated bundler to 2.1.4, tried gem update --system (resolved to 3.1.4), gem update --system 3.0.6, gem update --system 3.0.8 and gem update --system 3.2.0.rc.1. Nothing has changed, and the deprecation warning was shown also after running:

RUN gem update --system <any version>

On versions 3.0.6 and 3.0.8 I also got some more warnings and errors (I guess related to using Ruby 2.7.1).

I was hoping I can switch to Ruby 2.7 still on Ubuntu 18.04.

EDIT: Using DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=true works for now (at least I can build an image without any warnings). Thanks for all the hints.

How to fix it ???
Please help me step by steps.

@lavie3k Your issue is different from this pull-request. Can you file it the new issue?

Please help me step by steps.

This tracker is NOT the support forum. If you want to get the support for the several issues, https://stackoverflow.com/ may helps you.

I encountered this issue because the document How to Upgrade to Bundler 2, tells you to do gem update --system, under certain circumstances. Like many here, I was using Ubuntu 18.04 - the current LTS version of Ubuntu, and at the time Bundler 2 depended on rubygems3, so I blindly went ahead with the system update.

There should be a big warning in that document that doing this may destabilise your system. I would not have entered this command if I had been thinking straight! What you get with an Ubuntu release is a set of packages that have been carefully tested, so that they work together. Doing gem update --system breaks that.

For what it's worth, I think it was a mistake for Bundler to depend on on RubyGems 3, as it did when it was announced:

Bundler 2 requires RubyGems 3.0, so install that first by running:
$ gem update --system

Looking again at How to Upgrade to Bundler 2, I see that it now says:

The big change is that Bundler now requires at least Ruby 2.3.0 and RubyGems 2.5.0.

I wonder what brought about that change??? Anyway, this has been a bit of a rant, but

  • I do think that doc needs to warn of the possibly destabilising effect of gem update --system
  • Perhaps there's a solution to this issue for some people, based on Bunder2 now only needing rubygems 2.5.0?

That's for your feedback @matt-wallis

For what it's worth, I think it was a mistake for Bundler to depend on on RubyGems 3, as it did when it was announced:

Yep, this was a mistake.

There should be a big warning in that document that doing this may destabilise your system. I would not have entered this command if I had been thinking straight! What you get with an Ubuntu release is a set of packages that have been carefully tested, so that they work together. Doing gem update --system breaks that.

Yeah, we're working towards that goal. @simi just suggested this which I find a very good idea. We also provided a way for OS packagers to completely disable gem update --system: https://github.com/rubygems/rubygems/pull/3720.

That's for your feedback @matt-wallis

@deivid-rodriguez you're welcome.

Perhaps there's a solution to this issue for some people, based on Bunder2 now only needing rubygems 2.5.0?

Might a solution to this issue for the people who are here becasue of bundler's advice be gem update --system 2.5.x? And if so, shouldn't that be in the docs (with lots of clarification...). Having said that, I'm just guessing, and I don't understand this stuff in any depth. Maybe I'm being na茂ve.

Might a solution to this issue for the people who are here becasue of bundler's advice be gem update --system 2.5.x?

That's the oldest rubygems we currently support, it sounds like downgrading too much to me, and it might lead to other issues. I'm happy to add a note to the docs telling people that updated the rubygems version shipped by a OS packaged ruby through gem update --system, that they can partially undo the upgrade to get rid of the warnings with gem update --system 3.0.8.

That's the oldest rubygems we currently support, it sounds like downgrading too much to me, and it might lead to other issues.

That makes sense.

I'm happy to add a note to the docs telling people that updated the rubygems version shipped by a OS packaged ruby through gem update --system, that they can partially undo the upgrade to get rid of the warnings with gem update --system 3.0.8.

Sounds like a good idea. I guess this problem will go away for those on Ubuntu 18.04 once they upgrade to 20.04? I see that 20.04.1 is due 2020-08-06, and at this point 18.04 users will be notified that a new OS version is available.

We now provide a way for OS packagers to disable non-OS rubygems upgrades, and we hope it will be used. There's also workaround steps in this thread.

We should be more careful in the future when deprecating stuff used by OS package extension, but I think I'm going to proceed with closing this, because there's not too much we can do at this point, and fixed OS packages will slow start reaching users so this will be less of an issue as time passes.

Ok, closing then!

I was getting these warning messages today. Output:

$ bundle exec gem --version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
3.1.4

As @rennex said, I downgraded with

$ gem update --system 3.0.6

and after some more of these messages, RubyGems system software updated and no more warnings :D

Fixed! :tada:

@voghDev Too bad that you didn't see that you should have downgraded to 3.0.8

$ gem update --system 3.0.8

馃帀

@voghDev Too bad that you didn't see that you should have downgraded to 3.0.8

$ gem update --system 3.0.8

Thanks for the observation. I'll "down-upgrade" to 3.0.8 then :tada: :joy:

$ gem update --system 3.0.8

:purple_heart:

ruby 2.6.1
rails 6.0
MAC OSX 10.9.5
Bundler version 2.1.4
gem -v 3.0.8

After running gem update --system 3.0.8 the warning: already initialized constant message disappeared from tests (where it is truly annoying!). But not out of the woods yet. When creating scaffolds, migrating -rake tasks, paaprently- those errors appear.

So my conclusion, since rails testing essentially recreates the database then destroys it, that to eliminate the warnings the db needs to be exported, dropped, recreated and re-imported?

Is this assumption correct? [checking in case I may be missing something and blunder into something]

@voghDev Too bad that you didn't see that you should have downgraded to 3.0.8

$ gem update --system 3.0.8

Thanks for the observation. I'll "down-upgrade" to 3.0.8 then tada joy

$ gem update --system 3.0.8

purple_heart

worked on kali

Was this page helpful?
0 / 5 - 0 ratings