class Gem::MissingSpecError

当尝试激活一个 gem,而该 gem 不存在于系统上时引发。为了捕获所有类型的加载错误,请从超类 Gem::LoadError 中救援,而不是从这个类中救援。

公共类方法

new(name, requirement, extra_message=nil) 点击切换源码
调用超类方法
# File rubygems/errors.rb, line 29
def initialize(name, requirement, extra_message=nil)
  @name        = name
  @requirement = requirement
  @extra_message = extra_message
  super(message)
end

私有实例方法

build_message() 点击切换源码
# File rubygems/errors.rb, line 43
def build_message
  total = Gem::Specification.stubs.size
  "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
end