123456789_123456789_123456789_123456789_123456789_

Exception: Gem::UnsatisfiableDependencyError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, DependencyError, Exception, RuntimeError
Instance Chain:
self, DependencyError, Exception, RuntimeError
Inherits: Gem::DependencyError
Defined in: lib/rubygems/exceptions.rb

Overview

Raised by Resolver when a dependency requests a gem for which there is no spec.

Class Method Summary

Instance Attribute Summary

  • #dependency readonly

    The unsatisfiable dependency.

  • #errors rw

    Errors encountered which may have contributed to this exception.

Exception - Inherited

Instance Method Summary

  • #name

    The name of the unresolved dependency.

  • #version

    The Requirement of the unresolved dependency (not Version).

Constructor Details

.new(dep, platform_mismatch = nil) ⇒ UnsatisfiableDependencyError

Creates a new UnsatisfiableDependencyError for the unsatisfiable Resolver::DependencyRequest dep

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 241

def initialize dep, platform_mismatch=nil
  if platform_mismatch and !platform_mismatch.empty?
    plats = platform_mismatch.map { |x| x.platform.to_s }.sort.uniq
    super "Unable to resolve dependency: No match for '#{dep}' on this platform. Found: #{plats.join(', ')}"
  else
    if dep.explicit?
      super "Unable to resolve dependency: user requested '#{dep}'"
    else
      super "Unable to resolve dependency: '#{dep.request_context}' requires '#{dep}'"
    end
  end

  @dependency = dep
  @errors     = []
end

Instance Attribute Details

#dependency (readonly)

The unsatisfiable dependency. This is a Resolver::DependencyRequest, not a Dependency

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 230

attr_reader :dependency

#errors (rw)

Errors encountered which may have contributed to this exception

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 235

attr_accessor :errors

Instance Method Details

#name

The name of the unresolved dependency

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 260

def name
  @dependency.name
end

#version

The Requirement of the unresolved dependency (not Version).

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 267

def version
  @dependency.requirement
end