123456789_123456789_123456789_123456789_123456789_

Exception: Gem::MissingSpecError

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, LoadError, LoadError
Instance Chain:
self, LoadError, LoadError
Inherits: Gem::LoadError
Defined in: lib/rubygems/errors.rb

Overview

Raised when trying to activate a gem, and that gem does not exist on the system. Instead of rescuing from this class, make sure to rescue from the superclass LoadError to catch all types of load errors.

Class Method Summary

Instance Attribute Summary

LoadError - Inherited

#name

Name of gem.

#requirement

Version requirement of gem.

Instance Method Summary

Constructor Details

.new(name, requirement) ⇒ MissingSpecError

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 28

def initialize name, requirement
  @name        = name
  @requirement = requirement
end

Instance Method Details

#build_message (private)

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 40

def build_message
  total = Gem::Specification.stubs.size
  "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
end

#message

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 33

def message # :nodoc:
  build_message +
    "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
end