123456789_123456789_123456789_123456789_123456789_

Exception: Gem::MissingSpecVersionError

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

Overview

Raised when trying to activate a gem, and the gem exists on the system, but not the requested version. 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, specs) ⇒ MissingSpecVersionError

[ GitHub ]

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

def initialize(name, requirement, specs)
  @specs = specs
  super(name, requirement)
end

Instance Attribute Details

#specs (readonly)

[ GitHub ]

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

attr_reader :specs

Instance Method Details

#build_message (private)

[ GitHub ]

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

def build_message
  names = specs.map(&:full_name)
  "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ","}]\n"
end