class Bundler::Resolver

def raise_not_found!(package)

def raise_not_found!(package)
  name = package.name
  source = source_for(name)
  specs = @all_specs[name]
  matching_part = name
  requirement_label = SharedHelpers.pretty_dependency(package.dependency)
  cache_message = begin
                      " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
                    rescue GemfileNotFound
                      nil
                    end
  specs_matching_requirement = filter_matching_specs(specs, package.dependency.requirement)
  not_found_message = if specs_matching_requirement.any?
    specs = specs_matching_requirement
    matching_part = requirement_label
    platforms = package.platforms
    if platforms.size == 1
      "Could not find gem '#{requirement_label}' with platform '#{platforms.first}'"
    else
      "Could not find gems matching '#{requirement_label}' valid for all resolution platforms (#{platforms.join(", ")})"
    end
  else
    "Could not find gem '#{requirement_label}'"
  end
  message = String.new("#{not_found_message} in #{source}#{cache_message}.\n")
  if specs.any?
    message << "\n#{other_specs_matching_message(specs, matching_part)}"
  end
  raise GemNotFound, message
end