From b0a754a183b644af21248de28d277516287524d2 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 16 Feb 2021 17:11:13 -0600 Subject: [PATCH] Add Update The Gmefile Bundled With Version as a Ruby til --- README.md | 3 +- ...update-the-gemfile-bundled-with-version.md | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ruby/update-the-gemfile-bundled-with-version.md diff --git a/README.md b/README.md index f9ab2bf..67141cd 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_1050 TILs and counting..._ +_1051 TILs and counting..._ --- @@ -899,6 +899,7 @@ _1050 TILs and counting..._ - [Uninstall Specific Version Of A Ruby Gem](ruby/uninstall-specific-version-of-a-ruby-gem.md) - [Unpacking Strings Into Binary](ruby/unpacking-strings-into-binary.md) - [Up And Down With Integers](ruby/up-and-down-with-integers.md) +- [Update The Gemfile Bundled With Version](ruby/update-the-gemfile-bundled-with-version.md) - [Use A Case Statement As A Cond Statement](ruby/use-a-case-statement-as-a-cond-statement.md) - [Use dotenv In A Non-Rails Project](ruby/use-dotenv-in-a-non-rails-project.md) - [Use Tap For Better Test Data Setup](ruby/use-tap-for-better-test-data-setup.md) diff --git a/ruby/update-the-gemfile-bundled-with-version.md b/ruby/update-the-gemfile-bundled-with-version.md new file mode 100644 index 0000000..1430c53 --- /dev/null +++ b/ruby/update-the-gemfile-bundled-with-version.md @@ -0,0 +1,29 @@ +# Update The Gemfile Bundled With Version + +When you run `bundle install`, whatever is the latest version of `bundler` +installed locally will be used. Your `Gemfile` dependencies will be installed +and the `Gemfile.lock` will be marked at the bottom with a signature for the +version of `bundler` that was used. + +```ruby +# Gemfile.lock +... + +BUNDLED WITH + 1.1.17 +``` + +On future `bundle install` calls, a matching major version of Bundler will be +used. If you'd like to migrate from 1.x.x to 2.x.x or vice versa, or even if +you want to explicitly change minor versions, you can run: + +```bash +$ bundle update --bundler=2.2.4 +``` + +This will bundle your project with `2.2.4` and update the `BUNDLED WITH` +section to reflect that. + +Use the version that makes sense for you with the `--bundler` flag. + +[source](https://bundler.io/guides/bundler_2_upgrade.html#upgrading-applications-from-bundler-1-to-bundler-2)