Luis L. wrote:
Or have I fundamentally misunderstood what that’s for? (Quite likely.)
Something like that.
The problem is not RubyGems, but Ruby’s own “gem-prelude”
functionality.
The version of RubyGems that is bundled with Ruby is not meant to be
updated by the normal mechanism.
The documentation says otherwise:
# gem help update
Usage: gem update GEMNAME [GEMNAME ...] [options]
Options:
--system Update the RubyGems system
software
If the ‘gem update --system’ functionality isn’t meant to be used,
then why is it even there, and documented? Shouldn’t it be removed? At
least, that’s what the RubyGems maintainers told the Debian
maintainers, IIRC.
Until that is sorted in Ruby, we can’t do anything.
I thought the whole point of putting stuff into Ruby was to avoid
version conflicts like this? I remember the developers of RubyOPAL
warning that putting RubyGems into Ruby would make it impossible to
develop better package management systems; I bet they never thought
that one of those better package management systems would be RubyGems
itself (-:
I guess the best part of this situation is that it will hopefully shut
up the “cram everything into Ruby” proponents and strengthen the
arguments of the proponents of unbundling.
We could have limited the gem update version matching, but then it
will raise questions like “I’m using Ruby 1.9.x and I’m not getting
RubyGems 1.4.0 when doing gem update --system”
So, the issue will be similar: inability to update RubyGems, either by
the gem requirement or by Ruby’s own issues.
But the message won’t.
With the version restriction in the gemspec, you would get something
like
# gem update --system
Updating RubyGems
Updating rubygems-update
ERROR: Error installing rubygems-update:
rubygems-update requires Ruby version < 1.9.
Whereas right now, you actually get this:
# gem update --system
<internal:lib/rubygems/custom_require>:29: warning: loading in
progress, circular require considered harmful -
C:/Ruby/lib/ruby/1.9.1/rubygems.rb
from C:/Ruby/bin/gem:8:in <main>' from <internal:lib/rubygems/custom_require>:29:in
require’
from internal:lib/rubygems/custom_require:29:in require' from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:1136:in
<top
(required)>’
from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:968:in
load_plugins' from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:968:in
each’
from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:976:in block in load_plugins' from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:976:in
load’
from
C:/Ruby/lib/ruby/gems/1.9.1/gems/yard-0.6.4/lib/rubygems_plugin.rb:2:in
<top (required)>' from <internal:lib/rubygems/custom_require>:29:in
require’
from internal:lib/rubygems/custom_require:29:in require' from C:/Ruby/lib/ruby/1.9.1/rubygems/doc_manager.rb:8:in
<top (required)>’
from internal:lib/rubygems/custom_require:29:in require' from <internal:lib/rubygems/custom_require>:29:in
require’
Updating RubyGems
Updating rubygems-update
Temporarily enhancing PATH to include DevKit…
Successfully installed rubygems-update-1.4.1
Updating RubyGems to 1.4.1
Installing RubyGems 1.4.1
C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/source_index.rb:62:in
installed_spec_directories': undefined method
path’ for Gem:Module
(NoMethodError)
from
C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/source_index.rb:52:in
from_installed_gems' from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:914:in
source_index’
from
C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/gem_path_searcher.rb:98:in
init_gemspecs' from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/gem_path_searcher.rb:13:in
initialize’
from
C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:873:in
new' from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:873:in
searcher’
from
C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:495:in
find_files' from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:1034:in
load_plugins’
from
C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/gem_runner.rb:84:in
<top (required)>' from <internal:lib/rubygems/custom_require>:29:in
require’
from internal:lib/rubygems/custom_require:29:in require' from setup.rb:25:in
’
RubyGems system software updated
You actually get a success message. You also get a NoMethodError
exception, of course, but that exception is accompanied by a warning,
which looks exactly like an exception, and which you learned to
automatically mentally filter out, since you always get tons of
warnings from Ruby (circular require), from RubyGems (something about
instance variable @prerelease not initialized and Win32API being
deprecated) and literally tens of thousands of warnings from YARD (two
warnings about two different uninitialized instance variables and an
overlapping range in a character class in a Regexp for every pass of
every visitor over every AST node of every file of every Gem).
jwm