Content Deep Dive
How to use different Gemfiles with Bundler
Blog post from Semaphore
Post Details
Company
Date Published
Author
Marko Anastasov
Word Count
145
Language
English
Hacker News Points
-
Summary
When working on Ruby projects with Bundler, developers typically use a Gemfile to manage dependencies, but managing multiple gem versions over time can be complex. To address this, Bundler allows the use of multiple Gemfiles within a single branch by passing the environment variable BUNDLE_GEMFILE to its commands. For example, specifying BUNDLE_GEMFILE=Gemfile-rails4 allows users to install and test gems specific to that Gemfile. On Semaphore, it's recommended to create a new project with tailored build commands for a custom Gemfile.