Exception: Gem::UnsatisfiableDependencyError

Inherits:
DependencyError show all
Defined in:
lib/rubygems/exceptions.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep, platform_mismatch = nil) ⇒ UnsatisfiableDependencyError

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



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# 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

#dependencyObject (readonly)

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



254
255
256
# File 'lib/rubygems/exceptions.rb', line 254

def dependency
  @dependency
end

#errorsObject

Errors encountered which may have contributed to this exception



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

def errors
  @errors
end

Instance Method Details

#nameObject

The name of the unresolved dependency



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

def name
  @dependency.name
end

#versionObject

The Requirement of the unresolved dependency (not Version).



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

def version
  @dependency.requirement
end