Bundler, a Gem Among Gems

When writing a ruby program we incorporate code libraries (gems) into our code files that have already been created to make features that we might not have created ourselves. Gem dependencies are the gems that are required for a Ruby application to function. Bundler was created to help manage these dependencies by allowing a one-line installation for all the gems necessary to get our code to work.

Each program keeps track of its gem dependencies in a file called gemfile. If there is a gem we need to include in our program, we must record that in the gemfile.

Gemfile code

Without Bundler, running the application on a new machine would require individual installation of each gem. Bundler checks the gemfile, gets the code from each gem, and incorporates it into our program with the simple terminal command bundle.

How does bundler get installed?

Being a gem itself, Bundler does need to be installed and it doesn’t magically install itself — you have to write `gem install bundler` to get the bundler going. Bundler has been considered so relevant that Ruby 2.6 is going to have bundler included already, so no need to install it separately.

Keep using bundle to incorporate all of your gem dependencies in the most quick and easy way, and appreciate the efficiency this gem allows us in our coding adventures.