My current problem is that running any gem command results in warnings about Gem::Specification#rubyforge_project= for _every gem you have installed that uses rubyforge_project = ... in their gemspec.
Unfortunately, two such gems are on my system because I use Vagrant for some things (erubis and a 3+ year old version of childprocess).
This issue is related to:
gemHere are my current environment details, which conveniently demonstrates the problem:
$ gem env version
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/gems/specifications/childprocess-0.5.9.gemspec:16.
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/gems/specifications/erubis-2.7.0.gemspec:17.
3.1.0.pre2
I will abide by the code of conduct.
~@duckinator How is that a bug?~
~They should remove that from their gemspec. rubyforge_project= is deprecated and not encouraged to use isn't it?~
Thought you were using those gems specifically 🙈. Will give this a look
@duckinator I poked around this and i'm not able to reproduce it.
➜ rubygems git:(97e97686) ✗ gem list | grep erubis
erubis (2.7.0)
➜ rubygems git:(97e97686) ✗ gem env version
3.1.0.pre2
Can you share your gem env?
Output of
gem env
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/gems/specifications/childprocess-0.5.9.gemspec:16.
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/gems/specifications/erubis-2.7.0.gemspec:17.
RubyGems Environment:
- RUBYGEMS VERSION: 3.1.0.pre2
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/share/gems
- USER INSTALLATION DIRECTORY: /home/puppy/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /usr/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/bin
- SPEC CACHE DIRECTORY: /home/puppy/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/share/gems
- /home/puppy/.gem/ruby/2.6.0
- /usr/local/share/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--suggestions --user-install --no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/puppy/.cargo/bin
- /home/puppy/.cargo/bin
- /home/puppy/bin
- /home/puppy/.local/bin
- /home/puppy/.gem/ruby/bin
- /home/puppy/.npm-global/bin
- /home/puppy/go/bin
- /usr/bin
- /usr/sbin
- /usr/local/bin
- /usr/local/sbin
- /home/puppy/.gem/ruby/2.6.0/bin
- /var/lib/flatpak/exports//bin
I also discovered that require 'rubygems/gem_runner' was enough to reproduce it.
I was then able to narrow that down to Gem.load_plugins, and ultimately to this block in Gem.find_latest_files():
files.concat Gem::Specification.latest_specs(true).map { |spec|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
}.flatten
Just further simplified that to Gem::Specification._all, and then narrowed it down to one line of that function:
@@all = stubs.map(&:to_spec)
And, going off of that,
$ ruby -e 'Gem::Specification.stubs.map(&:to_spec)'
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/gems/specifications/childprocess-0.5.9.gemspec:16.
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/gems/specifications/erubis-2.7.0.gemspec:17.
$
following
Reproduced on Fedora 30 using RubyGems 3.1.1 + childprocess/erubis gems installed via dnf (not RubyGems); can't reproduce in a Debian-based Docker container. Going to try a Fedora-based Docker container, now.
I can reproduce on the Fedora 30 docker image, but not the Fedora 31 docker image:
$ docker run --rm -it fedora:30 /bin/bash -c 'dnf install -y ruby rubygems rubygem-erubis >/dev/null && gem update --system --install-dir=/usr/share/gems --bindir /usr/local/bin >/dev/null && gem env version'
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/gems/specifications/erubis-2.7.0.gemspec:17.
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/gems/specifications/erubis-2.7.0.gemspec:17.
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/gems/specifications/erubis-2.7.0.gemspec:17.
3.1.1
$
@lucaszmoraes what operating system/version were you encountering this on?
Looks like it's fixed on Fedora 31 because:
rubygems-* packages to remove the s.rubyforge_project = ... line.As for Fedora 30, it's still reproducible.
I haven't looked at gem 'build' code, but I noticed that a repo I just forked had rubyforge_project in its gemspec. The 'versioned' gemspec of the installed gem in the specifications folder did not.
I looked at the packaged gem, and rubyforge_project doesn't appear in the gem package 'metadata'.
So, might it be the packaging system rather than the install system? I think that made sense...
@MSP-Greg yeah, that could be it. I'm not too familiar with how Fedora repackages gems.
I'm getting quite the same messages on Ubuntu 16 LTS:
when i use just rails c
/home/alex/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
Loading development environment (Rails 6.0.0)
Gem::Specification#rubyforge_project= called from /home/alex/pnv/vendor/bundle/ruby/2.5.0/specifications/warden-1.2.8.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 /home/alex/pnv/vendor/bundle/ruby/2.5.0/specifications/sprockets-3.7.2.gemspec:19.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
And warden-1.2.8 has rubyforge_project in its metadata.
Ideally, there should only be a message shown on build, not with any other gem operations. A quick look at the code seemed to show that would rather messy...
Yep, seeing this on RHEL8 with rbenv using rubygems 3.1.1. Seems to pickup any gem installed on my system. Agree that it should only happen on build, not with gem commands.
I did manage to get a couple gem authors to remove that spec item, but the reality is that some of these gems are OLD, and will not likely see an update without you forking it.
@a-ta-ta my understanding is that if you're actively using a gem with rubyforge_project metadata (such as when running rails c in a Rails app that uses such a gem), the warning is expected with the current implementation. My thoughts on this are basically the same as @MSP-Greg said above.
@djberg96 are you getting the warnings when running things like gem env version, or only when running commands provided by a gem (such as rails c)?
@duckinator Even doing stuff like gem search would trigger the warnings. I've downgraded to 3.0.6 for now.
https://gist.github.com/djberg96/e5de578f6184ce12038f968bf12548f2
I have the same issue with json 2.2 and JRuby on OSX.
$ gem env version
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 /Users/bti/.rvm/rubies/jruby-head/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.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 /Users/bti/.rvm/rubies/jruby-head/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.gemspec:18.
3.1.1
$ gem uninstall json
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 /Users/bti/.rvm/rubies/jruby-head/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.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 /Users/bti/.rvm/rubies/jruby-head/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.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 /Users/bti/.rvm/rubies/jruby-head/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.gemspec:18.
Gem json-2.2.0-java cannot be uninstalled because it is a default gem
Successfully uninstalled json-2.3.0-java
I have the same if I try to install json-2.3.0 as default, then uninstall it.
To reproduce:
$ rvm install jruby-head
$ rvm use jruby-head
$ gem -v
@lucaszmoraes what operating system/version were you encountering this on?
@duckinator Ubuntu 18.04 (Bionic Beaver)
Confirmed @benoittgt's report: JRuby 9.2.8.0 or 9.2.9.0 + the default json 2.2.0 that ships with it, on any platform, causes this problem.
As far as I can tell, there is no way to fix this right now, because it is a default gem. Even installing json 2.3.0 didn't fix it, for me. It kept giving warnings about the default 2.2.0 version.
~@lucaszmoraes I couldn't reproduce it on Ubuntu 18.04 (at least with MRI Ruby), but since I can reproduce it with any JRuby installation or on Fedora 30, it's not a problem.~
NEVERMIND I REPRODUCED IT. Exactly the same way as on Fedora 30.
Docker commands to reproduce:
docker run --rm -it fedora:30 /bin/bash -c 'dnf install -y ruby rubygems rubygem-erubis >/dev/null && gem update --system --install-dir=/usr/share/gems --bindir /usr/local/bin >/dev/null && gem env version'docker run --rm -it debian:10 /bin/bash -c 'apt-get update &>/dev/null && apt-get install -y ruby ruby-erubis &>/dev/null && gem update --system &>/dev/null && gem env version'docker run --rm -it ubuntu:18.04 /bin/bash -c 'apt-get update &>/dev/null && apt-get install -y ruby ruby-erubis &>/dev/null && gem update --system &>/dev/null && gem env version'jgem env versiongreat, @duckinator. If you need more help regarding Ubuntu 18.04, let me know.
@duckinator
See https://github.com/rubygems/rubygems/pull/3047 for a possible fix. I haven't looked at RG tests for a while, maybe someone can throw together the needed code...
@MSP-Greg that approach seems pretty good; I'm largely taking a break from RubyGems stuff this week, so will give it a proper review + look into adding tests for it next week.
@duckinator
Thanks.
I revisited this, and came up with a simple repo case. The main issue is a *.gem with rubyforge_project= in its metadata needs to be installed with an older version of RubyGems. I used Ruby 2.5.7. Then, do a gem update --system, and the warning will appear.
Note that if one uses a current version of RubyGems to install the gem, rubyforge_project= is ignored and won't appear in the *.gemspec file...
Anyway, came up with a much simpler solution. See PR https://github.com/rubygems/rubygems/pull/3051
It's basically one line of code, but I moved an array to the top of Specification as a constant and added comments. So it's two...
Happy Holidays, Greg
On MacOS running sudo gem update --system:
Installing RubyGems 3.1.2
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 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/specifications/nokogiri-1.5.6.gemspec:22.
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem
On MacOS running
sudo gem update --system:Installing RubyGems 3.1.2 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 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/specifications/nokogiri-1.5.6.gemspec:22. ERROR: While executing gem ... (Errno::EPERM) Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem
the same , macos 10.14.6 mojave。Why??????
@mileslane this issue is about the warnings related to deprecations (lines 2 and 3 of what you pasted above), which can be safely ignored. Your error looks similar to #2956 — try running gem update --system (without sudo). If you still have the same problem, open a new issue and someone will try to help. :slightly_smiling_face:
@albertli1 are you getting the same Operation not permitted line as @mileslane? If so, try gem update --system without sudo and let me know how it goes. If you're still having the same problem I'll make sure there's an open issue about it and we can move the conversation there. :+1:
@duckinator without sudo get the follow message:
gem update --system
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 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/specifications/nokogiri-1.5.6.gemspec:22.
Latest version already installed. Done.
It seems install successful, current gem version is 3.1.2
gem -v
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 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/specifications/nokogiri-1.5.6.gemspec:22.
3.1.2
ruby version 2.3.7p456
ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
@albertli1 awesome. The remaining warning about rubyforge_project= being deprecated can be safely ignored, so you should be good now. :+1:
This should be resolved when a release is made which includes #3108.
Until then, the workaround should be to just downgrade to 3.0: gem update --system 3.0.0
@duckinator and it works well
This should be resolved when a release is made which includes #3108.
Until then, the workaround should be to just downgrade to 3.0:
gem update --system 3.0.0
i'm sorry but, is there any downsides or something important that I should know before downgrading?
@lucaszmoraes you may be missing some other bug fixes and some smaller features, but there shouldn't be major problems in _most_ cases.
Also, I double-checked, and you should be able upgrade to 3.0.6 (via gem update --system 3.0.6) without issue.
Thanks!
Em qua, 11 de mar de 2020 22:30, Ellen Marie Dash notifications@github.com
escreveu:
@lucaszmoraes https://github.com/lucaszmoraes you may be missing some
other bug fixes and some smaller features, but there shouldn't be major
problems in most cases.Also, I double-checked, and you should be able upgrade to 3.0.6 (via gem
update --system 3.0.6) without issue.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rubygems/rubygems/issues/2984#issuecomment-597961550,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABMNBZ4A7KTJTVG5MR7I5H3RHA3L7ANCNFSM4JK6XGKQ
.
3.1.4 was released - https://blog.rubygems.org/2020/06/03/3.1.4-released.html fixing this problem.
You can update by running gem update --system 3.1.4.
I think this can be closed.
Most helpful comment
This should be resolved when a release is made which includes #3108.
Until then, the workaround should be to just downgrade to 3.0:
gem update --system 3.0.0