Skip to content

Commit 703ff00

Browse files
authored
Merge pull request #190 from rubygems/martinemde/add-post-by-ngan-pham
Auto-install blog post by guest author Ngan Pham
2 parents fb711bc + 8e16c09 commit 703ff00

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Bundler Auto-Install Just Got A Whole Lot Better
3+
layout: post
4+
author: Ngan Pham
5+
author_email: nganpham@gmail.com
6+
---
7+
8+
_The RubyGems Team is happy to share this post from our colleague Ngan Pham, Principle Software Engineer @ Gusto. Thank you, Ngan!_
9+
10+
Working in a large monolith with many engineers, you never fail to get a flurry of changes everytime you pull from `main`.
11+
Then you have the typical ritual of running `bundle install` and, if you're on a Rails application, `rails db:prepare`.
12+
Sometimes, you forget to run `bundle install` and get this message:
13+
14+
```
15+
Could not find X-1.2.3 in locally installed gems
16+
Run `bundle install` to install missing gems.
17+
```
18+
19+
As of Bundler 2.5.10, you can now enable the `auto_install` config to have Bundler automatically install your bundle on demand.
20+
Simply set it in your project (or globally) with:
21+
22+
```
23+
bundle config auto_install true
24+
# or
25+
bundle config --global auto_install true
26+
```
27+
28+
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.
29+
30+
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 use `require "bundler/setup"` by default) will now _just work_.
31+
32+
It's a small change but it results in a big quality of life improvement. Try it out!
33+
34+
---
35+
36+
_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)._

0 commit comments

Comments
 (0)