Exception: Gem::MissingSpecError

Inherits:
LoadError
  • Object
show all
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 Gem::LoadError to catch all types of load errors.

Direct Known Subclasses

MissingSpecVersionError

Instance Attribute Summary

Attributes inherited from LoadError

#name, #requirement

Instance Method Summary collapse

Constructor Details

#initialize(name, requirement, extra_message = nil) ⇒ MissingSpecError

Returns a new instance of MissingSpecError.



28
29
30
31
32
# File 'lib/rubygems/errors.rb', line 28

def initialize(name, requirement, extra_message=nil)
  @name        = name
  @requirement = requirement
  @extra_message = extra_message
end

Instance Method Details

#messageObject

:nodoc:



34
35
36
37
# File 'lib/rubygems/errors.rb', line 34

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