From 0c71faa0effe4d58c73e166b5fd0d632ba67b480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 18 Feb 2019 16:38:51 +0100 Subject: Fix warning message about bundler version To actually make the warning go away, we need to recommend exactly installing the locked version. Otherwise the latest version gets installed, but not used to being a different major than the one locked, so the warning stays. --- lib/bundler/lockfile_parser.rb | 6 +++--- spec/lock/lockfile_bundler_1_spec.rb | 4 +++- spec/lock/lockfile_spec.rb | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index a7d4dc56b7..cd42919da2 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -107,9 +107,9 @@ module Bundler when 0 if current_version < bundler_version Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \ - "than the version that created the lockfile (#{bundler_version}). We suggest you " \ - "upgrade to the latest version of Bundler by running `gem " \ - "install bundler#{prerelease_text}`.\n" + "than the version that created the lockfile (#{bundler_version}). We suggest you to " \ + "upgrade to the version that created the lockfile by running `gem install " \ + "bundler:#{bundler_version}#{prerelease_text}`.\n" end end end diff --git a/spec/lock/lockfile_bundler_1_spec.rb b/spec/lock/lockfile_bundler_1_spec.rb index 0e89645503..625068de38 100644 --- a/spec/lock/lockfile_bundler_1_spec.rb +++ b/spec/lock/lockfile_bundler_1_spec.rb @@ -180,7 +180,9 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do end warning_message = "the running version of Bundler (9999999.0.0) is older " \ - "than the version that created the lockfile (9999999.1.0)" + "than the version that created the lockfile (9999999.1.0). " \ + "We suggest you to upgrade to the version that created the " \ + "lockfile by running `gem install bundler:9999999.1.0`." expect(last_command.stderr.scan(warning_message).size).to eq(1) lockfile_should_be <<-G diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index a77ce83f9f..3ec079ac65 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -180,7 +180,9 @@ RSpec.describe "the lockfile format", :bundler => "2" do end warning_message = "the running version of Bundler (9999999.0.0) is older " \ - "than the version that created the lockfile (9999999.1.0)" + "than the version that created the lockfile (9999999.1.0). " \ + "We suggest you to upgrade to the version that created the " \ + "lockfile by running `gem install bundler:9999999.1.0`." expect(last_command.bundler_err).to include warning_message lockfile_should_be <<-G -- cgit v1.2.1