This is useful if you're working on a project with other developers and want to use different gems locally that you don't have to commit to the repository.
From this repository https://github.com/gerrywastaken/Gemfile.local. The rest the instructions here are mostly based on what is written there with some modifications.