Exception: Gem::UnsatisfiableDependencyError

Inherits:
Exception
  • Object
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

Attributes inherited from Exception

#source_exception

Instance Method Summary collapse

Constructor Details

#initialize(dep, platform_mismatch = nil) ⇒ UnsatisfiableDependencyError

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



229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/rubygems/exceptions.rb', line 229

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
end

Instance Attribute Details

#dependencyObject (readonly)

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



223
224
225
# File 'lib/rubygems/exceptions.rb', line 223

def dependency
  @dependency
end