Any time I definitely suggest you to check out Gemfile
if you use Ruby, but if you’re less familiar with Ruby / with bundler and Gemfile then that might be a bit of overkill, and maybe a simple gem install
(as described here: How to use a specific version of fastlane?) is easier to maintain.
Gemfile is definitely the best solution IMO, but only if you do use that locally too