do_rubygems_update (Gem::Commands::UpdateCommand)

    # File lib/rubygems/commands/update_command.rb, line 110
      def do_rubygems_update(version)
        args = []
        args.push '--prefix', Gem.prefix unless Gem.prefix.nil?
        args << '--no-rdoc' unless options[:generate_rdoc]
        args << '--no-ri' unless options[:generate_ri]

        update_dir = File.join Gem.dir, 'gems', "rubygems-update-#{version}"

        success = false

        Dir.chdir update_dir do
          say "Installing RubyGems #{version}"
          setup_cmd = "#{Gem.ruby} setup.rb #{args.join ' '}"

          # Make sure old rubygems isn't loaded
          if Gem.win_platform? then
            system "set RUBYOPT= & #{setup_cmd}"
          else
            system "RUBYOPT=\"\" #{setup_cmd}"
          end
        end
      end