BUNDLE_ONLY is now available

r7kamura

r7kamura

Posted on August 9, 2022

BUNDLE_ONLY is now available

I recently added BUNDLE_ONLY option to Bundler.

This is the long-awaited feature from 8+ years ago that allows you to install only the gem groups you need, available from bundler 2.3.19.

For example, in our Rails app, we have a crazy number of gem groups (terrible I know). There is a workflow to run RuboCop with GitHub Actions, but this workflow only requires the gems in the rubocop gem group to be installed.

# .github/workflows/rubocop.yml
 env:
-  BUNDLE_WITHOUT: >
-    danger
-    default
-    development
-    feature1
-    feature2
-    feature3
-    feature4
-    feature5
-    feature6
-    feature7
-    mobile
-    production
-    qa
-    staging1
-    staging2
-    staging3
-    test
+  BUNDLE_ONLY: rubocop
Enter fullscreen mode Exit fullscreen mode

Previously, it was necessary to use BUNDLE_WITHOUT to exclude unwanted gem groups one by one, but now BUNDLE_ONLY allows us to write this way 😃

💖 💪 🙅 🚩
r7kamura
r7kamura

Posted on August 9, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related