Specify Gemfile for bundle

Posted . Visible to the public.

Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable.

BUNDLE_GEMFILE=Gemfile.rails.7.2 bundle

By default, bundler will look for a file called Gemfile in your project, but there may be cases where you want to have multiple Gemfiles in your project, which cannot all be named Gemfile. Let's say for example, you maintain a gem and want to run automated tests against multiple rails versions. When you need to bundle one of your secondary Gemfiles, the solution above is the way to go.

See this list Show archive.org snapshot for more available bundler options.

Bruno Sedler
Last edit
Bruno Sedler
License
Source code in this card is licensed under the MIT License.
Posted by Bruno Sedler to makandra dev (2025-01-17 15:48)