We have a Gemfile
currently in our git repository. However, there\'s a gem I use only locally in my environment (my team doesn\'t use it). In order to use it, I
Put below code at the top of your Gemfile.local
to load existing gemfile
:
if File.exists?('Gemfile') then
eval File.read('Gemfile')
end
It will load all gems from existing Gemfile
. You can add new gems also as you need.
Run below commands to install gems from new Gemfile.local
:
bundle install --gemfile=Gemfile.local
Set BUNDLE_GEMFILE
environment variable:
BUNDLE_GEMFILE=Gemfile.local bundle exec rails c
To provide a “delta” only in the Gemfile.local
put require_relative 'Gemfile'
on top of it (or Bundler::Dsl#eval_gemfile
as suggested by @MichaelKohl in comments.)