diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index bc29f17b51d..d422764909c 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -102,9 +102,9 @@ def warn_for_outdated_bundler_version prerelease_text = bundler_version.prerelease? ? " --pre" : "" current_version = Gem::Version.create(Bundler::VERSION) current_major_version = current_version.segments.first - major_bundler_version = bundler_version.segments.first - if current_major_version < major_bundler_version && current_major_version > 2 - raise LockfileError, "You must use Bundler #{major_bundler_version} or greater with this lockfile." + current_locked_version = bundler_version.segments.first + if current_major_version < current_locked_version && current_major_version > 2 + raise LockfileError, "You must use Bundler #{current_locked_version} or greater with this lockfile." end return unless current_version < bundler_version Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \