123456789_123456789_123456789_123456789_123456789_

Exception: Gem::ConflictError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, LoadError, LoadError
Instance Chain:
self, LoadError, LoadError
Inherits: Gem::LoadError
Defined in: lib/rubygems/errors.rb

Overview

Raised when there are conflicting gem specs loaded

Class Method Summary

Instance Attribute Summary

  • #conflicts readonly

    A Hash mapping conflicting specifications to the dependencies that caused the conflict.

  • #target readonly

    The specification that had the conflict.

LoadError - Inherited

#name

Name of gem.

#requirement

Version requirement of gem.

Constructor Details

.new(target, conflicts) ⇒ ConflictError

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 84

def initialize(target, conflicts)
  @target    = target
  @conflicts = conflicts
  @name      = target.name

  reason = conflicts.map do |act, dependencies|
    "#{act.full_name} conflicts with #{dependencies.join(", ")}"
  end.join ", "

  # TODO: improve message by saying who activated `con`

  super("Unable to activate #{target.full_name}, because #{reason}")
end

Instance Attribute Details

#conflicts (readonly)

A Hash mapping conflicting specifications to the dependencies that caused the conflict

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 77

attr_reader :conflicts

#target (readonly)

The specification that had the conflict

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 82

attr_reader :target