summaryrefslogtreecommitdiff
path: root/lib/rubygems/installer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/installer.rb')
-rw-r--r--lib/rubygems/installer.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 6fd3399dd4..0cbca0791b 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -136,8 +136,9 @@ class Gem::Installer
end
##
- # Constructs an Installer instance that will install the gem located at
- # +gem+. +options+ is a Hash with the following keys:
+ # Constructs an Installer instance that will install the gem at +package+ which
+ # can either be a path or an instance of Gem::Package. +options+ is a Hash
+ # with the following keys:
#
# :bin_dir:: Where to put a bin wrapper if needed.
# :development:: Whether or not development dependencies should be installed.
@@ -157,6 +158,7 @@ class Gem::Installer
# :wrappers:: Install wrappers if true, symlinks if false.
# :build_args:: An Array of arguments to pass to the extension builder
# process. If not set, then Gem::Command.build_args is used
+ # :post_install_message:: Print gem post install message if true
def initialize(package, options={})
require 'fileutils'
@@ -471,7 +473,7 @@ class Gem::Installer
unless File.exist? bin_path then
# TODO change this to a more useful warning
- warn "#{bin_path} maybe `gem pristine #{spec.name}` will fix it?"
+ warn "`#{bin_path}` does not exist, maybe `gem pristine #{spec.name}` will fix it?"
next
end
@@ -608,7 +610,9 @@ class Gem::Installer
def ensure_required_ruby_version_met # :nodoc:
if rrv = spec.required_ruby_version then
unless rrv.satisfied_by? Gem.ruby_version then
- raise Gem::InstallError, "#{spec.name} requires Ruby version #{rrv}."
+ ruby_version = Gem.ruby_api_version
+ raise Gem::RuntimeRequirementNotMetError,
+ "#{spec.name} requires Ruby version #{rrv}. The current ruby version is #{ruby_version}."
end
end
end
@@ -616,8 +620,9 @@ class Gem::Installer
def ensure_required_rubygems_version_met # :nodoc:
if rrgv = spec.required_rubygems_version then
unless rrgv.satisfied_by? Gem.rubygems_version then
- raise Gem::InstallError,
- "#{spec.name} requires RubyGems version #{rrgv}. " +
+ rg_version = Gem::VERSION
+ raise Gem::RuntimeRequirementNotMetError,
+ "#{spec.name} requires RubyGems version #{rrgv}. The current RubyGems version is #{rg_version}. " +
"Try 'gem update --system' to update RubyGems itself."
end
end
@@ -821,7 +826,7 @@ TEXT
#
# Version and dependency checks are skipped if this install is forced.
#
- # The dependent check will be skipped this install is ignoring dependencies.
+ # The dependent check will be skipped if the install is ignoring dependencies.
def pre_install_checks
verify_gem_home options[:unpack]