If you want to add gems locally, which should not be committed to the repository:

  1. Create a Gemfile.local and put it in .gitignore:

    eval File.read('Gemfile')
     
    gem 'my-other-gem'
  2. Set an env var overriding the Gemfile location. For example, put it in .env if you use direnv.

    BUNDLE_GEMFILE=Gemfile.local