Report a load error during activation. The message of load error depends
on whether it was a version mismatch or if there are not gems of any
version by the requested name.
# File lib/rubygems.rb, line 878
def self.report_activate_error(gem)
matches = Gem::Specification.find_by_name(gem.name)
if matches.empty? then
error = Gem::LoadError.new(
"Could not find RubyGem #{gem.name} (#{gem.requirement})\n")
else
error = Gem::LoadError.new(
"RubyGem version error: " +
"#{gem.name}(#{matches.first.version} not #{gem.requirement})\n")
end
error.name = gem.name
error.requirement = gem.requirement
raise error
end