-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add post about auto-install by Ngan Pham
Signed-off-by: Martin Emde <me@martinemde.com>
- Loading branch information
1 parent
fb711bc
commit f4cd113
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
_posts/2024-05-30-bundler-auto-install-just-got-a-whole-lot-better.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: Bundler Auto-Install Just Got A Whole Lot Better | ||
layout: post | ||
author: Ngan Pham | ||
author_email: nganpham@gmail.com | ||
--- | ||
|
||
_The RubyGems Team is happy to share this post from our colleague Ngan Pham, Principle Software Engineer @ Gusto. Thank you, Ngan!_ | ||
|
||
Working in a large monolith with many engineers, you never fail to get a flurry of changes everytime you pull from `main`. | ||
Then you have the typical ritual of running `bundle install` and, if you're on a Rails application, `rails db:prepare`. | ||
Sometimes, you forget to run `bundle install` and get this message: | ||
|
||
``` | ||
Could not find X-1.2.3 in locally installed gems | ||
Run `bundle install` to install missing gems. | ||
``` | ||
|
||
As of Bundler 2.5.10, you can now enable the `auto_install` config to have Bundler automatically install your bundle on demand. | ||
Simply set it in your project (or globally) with: | ||
|
||
``` | ||
bundle config auto_install true | ||
# or | ||
bundle config --global auto_install true | ||
``` | ||
|
||
Auto-install is not a new concept. Commands like `bundle (show | binstubs | outdated | exec | open | console | license | clean)` already benefited from the `auto_install` config. | ||
|
||
However, the [recent enhancement](https://github.com/rubygems/rubygems/pull/6561) by [@technicalpickles](https://github.com/technicalpickles) made it work with anything that uses `require "bundler/setup"`. This means even binstubs (which uses `require "bundler/setup"` by default) will now _just work_. | ||
|
||
It's a small change but it results in a big quality of life improvement. Try it out! | ||
|
||
--- | ||
|
||
_If you would like to share a post about something you love about Bundler or RubyGems on the RubyGems.org blog, we encouraged you to [contribute here on GitHub](https://github.com/rubygems/rubygems.github.io) or talk to us on the [Bundler Slack](https://join.slack.com/t/bundler/shared_invite/zt-1rrsuuv3m-OmXKWQf8K6iSla4~F1DBjQ)._ |