class Gem::UnsatisfiableDependencyError

当依赖项请求一个没有规范的 gem 时,由解析器引发。

属性

dependency[R]

无法满足的依赖项。这是一个 Gem::Resolver::DependencyRequest,而不是 Gem::Dependency

errors[RW]

可能导致此异常的遇到的错误

公共类方法

new(dep, platform_mismatch=nil) 点击以切换源代码

为无法满足的 Gem::Resolver::DependencyRequest dep 创建一个新的 UnsatisfiableDependencyError

调用父类方法
# File rubygems/exceptions.rb, line 264
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

公共实例方法

name() 点击以切换源代码

未解析的依赖项的名称

# File rubygems/exceptions.rb, line 283
def name
  @dependency.name
end
version() 点击以切换源代码

未解析的依赖项的要求(不是版本)。

# File rubygems/exceptions.rb, line 290
def version
  @dependency.requirement
end