Bundler Handles Multiple Gem Versions on System
Bundler can handle this use case just fine. Your explicit gem dependencies go into your Gemfile, and all gem versions within the bundle are then stored in the Gemfile.lock file.
As a general rule, your gems will be installed in GEM_HOME. Multiple versions of a gem can be installed at the same time, and require bundler/setup
takes care of ensuring that the correct versions (as specified in your Gemfile.lock) are made available to your Ruby application.
However, unless you use binstubs, gemsets, or special invocations like <gem> _<version>_ [args]
, you will need to run bundle exec <gem>
from the command line in order to use the correct version as specified by your bundle.