diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 3e10b68783fa40..3173359749e62f 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -365,16 +365,15 @@ def to_lock def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false) msg = String.new - msg << "You are trying to install in deployment mode after changing\n" \ - "your Gemfile. Run `bundle install` elsewhere and add the\n" \ - "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control." + msg << "You are trying to install in deployment mode after changing your Gemfile.\n" \ + "Run `bundle install` elsewhere and add the updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control.\n" unless explicit_flag suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env) "bundle config set frozen false" end - msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \ - "freeze \nby running `#{suggested_command}`." if suggested_command + msg << "If this is a development machine, remove the #{Bundler.default_gemfile} " \ + "freeze by running `#{suggested_command}`." if suggested_command end added = [] diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 7a0d435860ba46..76aa046292d460 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -658,27 +658,27 @@ bundle "update", :all => true, :raise_on_error => false expect(last_command).to be_failure - expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m) - expect(err).to match(/freeze \nby running `bundle config set frozen false`./m) + expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/) + expect(err).to match(/freeze by running `bundle config set frozen false`./) end it "should fail loudly when frozen is set globally" do bundle "config set --global frozen 1" bundle "update", :all => true, :raise_on_error => false - expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). - and match(/freeze \nby running `bundle config set frozen false`./m) + expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/). + and match(/freeze by running `bundle config set frozen false`./) end it "should fail loudly when deployment is set globally" do bundle "config set --global deployment true" bundle "update", :all => true, :raise_on_error => false - expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). - and match(/freeze \nby running `bundle config set frozen false`./m) + expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/). + and match(/freeze by running `bundle config set frozen false`./) end it "should not suggest any command to unfreeze bundler if frozen is set through ENV" do bundle "update", :all => true, :raise_on_error => false, :env => { "BUNDLE_FROZEN" => "true" } - expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m) + expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/) expect(err).not_to match(/by running/) end end