make_destination_dirs (Gem::Commands::SetupCommand)

    # File lib/rubygems/commands/setup_command.rb, line 263
      def make_destination_dirs(install_destdir)
        lib_dir = nil
        bin_dir = nil

        prefix = options[:prefix]
        site_or_vendor = options[:site_or_vendor]

        if prefix.empty? then
          lib_dir = Gem::ConfigMap[site_or_vendor]
          bin_dir = Gem::ConfigMap[:bindir]
        else
          # Apple installed RubyGems into libdir, and RubyGems <= 1.1.0 gets
          # confused about installation location, so switch back to
          # sitelibdir/vendorlibdir.
          if defined?(APPLE_GEM_HOME) and
            # just in case Apple and RubyGems don't get this patched up proper.
            (prefix == Gem::ConfigMap[:libdir] or
             # this one is important
             prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then
             lib_dir = Gem::ConfigMap[site_or_vendor]
             bin_dir = Gem::ConfigMap[:bindir]
          else
            lib_dir = ENV['RUBYLIB']
            bin_dir = File.join prefix, 'bin'
          end
        end

        unless install_destdir.empty? then
          lib_dir = File.join install_destdir, lib_dir.gsub(/^[a-zA-Z]:/, '')
          bin_dir = File.join install_destdir, bin_dir.gsub(/^[a-zA-Z]:/, '')
        end

        mkdir_p lib_dir
        mkdir_p bin_dir

        return lib_dir, bin_dir
      end