Support for the Ruby 2.4 series has ended. See here for reference.

In Files

  • rubygems/commands/install_command.rb

Class/Module Index [+]

Quicksearch

Gem::Commands::InstallCommand

Gem installer command line tool

See `gem help install`

Public Class Methods

new() click to toggle source
 
               # File rubygems/commands/install_command.rb, line 22
def initialize
  defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({
    :format_executable => false,
    :lock              => true,
    :suggest_alternate => true,
    :version           => Gem::Requirement.default,
    :without_groups    => [],
  })

  super 'install', 'Install a gem into the local repository', defaults

  add_install_update_options
  add_local_remote_options
  add_platform_option
  add_version_option
  add_prerelease_option "to be installed. (Only for listed gems)"

  @installed_specs = []
end
            

Public Instance Methods

execute() click to toggle source
 
               # File rubygems/commands/install_command.rb, line 142
def execute

  if options.include? :gemdeps then
    install_from_gemdeps
    return # not reached
  end

  @installed_specs = []

  ENV.delete 'GEM_PATH' if options[:install_dir].nil? and RUBY_VERSION > '1.9'

  check_install_dir
  check_version

  load_hooks

  exit_code = install_gems

  show_installed

  terminate_interaction exit_code
end