We are about to ship a version of Ruby with a built in package manager with
the following property:

Given a package X with dependency Y, attempting to load X might require
dependency Z without any warning.

There is literally no other distribution of anything that would not consider
that property a major show-stopper. I am baffled about how this bug has
existed in the tracker so long, is considered "normal" priority, and has now
been bumped to 1.9.3 at the earliest.

Yehuda Katz
Architect | Engine Yard
(ph) 718.877.1325


On Fri, Jul 2, 2010 at 1:00 PM, Yusuke ENDOH <mame / tsg.ne.jp> wrote:

> Hi,
>
> 2010/7/3 Aaron Patterson <redmine / ruby-lang.org>:
> > How about an alternative solution to this problem?  If someone does:
> >
> >    require 'somegem'
> >
> > The latest version of 'somegem' gets required.  If someone does this:
> >
> >    require 'rubygems'
> >    require 'somegem'
> >
> > Then rubygems rules apply to subsequent gem requires.  The motivation
> behind this behavior comes from the idea that if someone doesn't require
> rubygems, then they don't want or care about rubygems version and activation
> rules.  If the user *does* require rubygems, then we assume that they care
> about such things.
>
> This may be a new feature.  However, I don't object it because this
> issue is actually a bug and we have no other solution (There will be
> another solution theretically, but not in practice in the sense that
> no one write a correct patch).
>
> But,
>
> > Attached is a patch that adds this behavior (originally written by Evan
> Phoenix).
>
> Your patch is not correct, unfortunately.  make test-all does not run:
>
>
> $ make test-all
> ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb
> ./tool/runruby.rb --extout=.ext  -- "./test/runner.rb"
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:103: warning: already
> initialized constant VERSION
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:103: warning: already
> initialized constant RubyGemsVersion
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:147: warning: already
> initialized constant MUTEX
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:149: warning: already
> initialized constant RubyGemsPackageVersion
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:155: warning: already
> initialized constant WIN_PATTERNS
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:1018: warning: already
> initialized constant MARSHAL_SPEC_DIR
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:1023: warning: already
> initialized constant YAML_SPEC_DIR
> /home/mame/work/ruby_1_9_2/lib/rubygems.rb:613:in `path': undefined
> method `default_path' for Gem:Module (NoMethodError)
>        from /home/mame/work/ruby_1_9_2/lib/rubygems/source_index.rb:68:in
> `installed_spec_directories'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems/source_index.rb:58:in
> `from_installed_gems'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:861:in
> `source_index'
>        from
> /home/mame/work/ruby_1_9_2/lib/rubygems/gem_path_searcher.rb:81:in
> `init_gemspecs'
>        from
> /home/mame/work/ruby_1_9_2/lib/rubygems/gem_path_searcher.rb:13:in
> `initialize'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:819:in `new'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:819:in `block
> in searcher'
>        from <internal:prelude>:10:in `synchronize'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:818:in `searcher'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:479:in `find_files'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:961:in
> `load_plugins'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems.rb:1118:in `<top
> (required)>'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems/custom_require.rb:31:in
> `require'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems/custom_require.rb:31:in
> `require'
>        from <internal:gem_prelude>:158:in `load_full_rubygems_library'
>        from /home/mame/work/ruby_1_9_2/test/rubygems/gemutilities.rb:6:in
> `<top (required)>'
>        from
> /home/mame/work/ruby_1_9_2/test/rubygems/test_gem_dependency_installer.rb:1:in
> `require_relative'
>        from
> /home/mame/work/ruby_1_9_2/test/rubygems/test_gem_dependency_installer.rb:1:in
> `<top (required)>'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems/custom_require.rb:31:in
> `require'
>        from /home/mame/work/ruby_1_9_2/lib/rubygems/custom_require.rb:31:in
> `require'
>        from /home/mame/work/ruby_1_9_2/lib/test/unit.rb:55:in `block
> in setup_argv'
>        from /home/mame/work/ruby_1_9_2/lib/test/unit.rb:49:in `each'
>        from /home/mame/work/ruby_1_9_2/lib/test/unit.rb:49:in `setup_argv'
>        from ./test/runner.rb:9:in `<main>'
> make: *** [yes-test-all] Error 1
>
> --
> Yusuke Endoh <mame / tsg.ne.jp>
>
>