method

install_gem

install_gem(name, version)
public

No documentation available.

# File lib/rubygems/commands/install_command.rb, line 191
  def install_gem(name, version) # :nodoc:
    return if options[:conservative] and
      not Gem::Dependency.new(name, version).matching_specs.empty?

    req = Gem::Requirement.create(version)

    if options[:ignore_dependencies]
      install_gem_without_dependencies name, req
    else
      inst = Gem::DependencyInstaller.new options
      request_set = inst.resolve_dependencies name, req

      if options[:explain]
        puts "Gems to install:"

        request_set.sorted_requests.each do |s|
          puts "  #{s.full_name}"
        end

        return
      else
        @installed_specs.concat request_set.install options
      end

      show_install_errors inst.errors
    end
  end