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.

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 265

def initialize(dep, platform_mismatch=nil)
  if platform_mismatch && !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 254

attr_reader :dependency

#errors (rw)

Errors encountered which may have contributed to this exception

[ GitHub ]

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

attr_accessor :errors

Instance Method Details

#name

The name of the unresolved dependency

[ GitHub ]

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

def name
  @dependency.name
end

#version

The Requirement of the unresolved dependency (not Version).

[ GitHub ]

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

def version
  @dependency.requirement
end