> After the three require 'rubygems' in setup.rb can you add:
> 
>    p $", $:
> 
> I'd like to see where/how your installed rubygems is getting loaded.

here's how it looks...

computer-says-no:/usr/local/src/rubygems-1.3.5 d$ sudo ruby setup.rb
Password:
["rubygems/rubygems_version.rb", "rubygems/defaults.rb", 
"thread.bundle", "thread.rb", "rbconfig.rb", "rbconfig/datadir.rb", 
"rubygems/exceptions.rb", "rubygems/requirement.rb", 
"rubygems/version.rb", "rubygems/dependency.rb", 
"rubygems/gem_path_searcher.rb", "rubygems/user_interaction.rb", 
"rubygems/platform.rb", "rubygems/specification.rb", 
"rubygems/source_index.rb", "rubygems/builder.rb", 
"rubygems/custom_require.rb", "rubygems.rb", "timeout.rb", 
"optparse.rb", "rubygems/command.rb", "rubygems/command_manager.rb", 
"stringio.bundle", "yaml/error.rb", "syck.bundle", "yaml/ypath.rb", 
"yaml/basenode.rb", "yaml/syck.rb", "yaml/tag.rb", "yaml/stream.rb", 
"yaml/constants.rb", "rational.rb", "date/format.rb", "date.rb", 
"yaml/rubytypes.rb", "yaml/types.rb", "yaml.rb", 
"rubygems/config_file.rb", "etc.bundle", "fileutils.rb", 
"rubygems/doc_manager.rb", "rubygems/gem_runner.rb"]
["lib", "/usr/local//lib/ruby/site_ruby/1.8", 
"/usr/local//lib/ruby/site_ruby/1.8/i686-darwin8.10.1", 
"/usr/local//lib/ruby/site_ruby", "/usr/local//lib/ruby/1.8", 
"/usr/local//lib/ruby/1.8/i686-darwin8.10.1", "."]
ERROR:  While executing gem ... (NoMethodError)
    undefined method `ruby_version' for Gem:Module
setup.rb:36: uninitialized constant Gem::SystemExitException (NameError)

-- 
Posted via http://www.ruby-forum.com/.