You created a new branch locally for your gem (
new-feature). You wanted to modify the gem and load it directly to your local Rails app. And, you don't want to push the gem changes to GitHub and publish the gem to RubyGems just yet.
You want all the changes that you made in your local gem directory get reflected immediately in your local Rails app without requiring you to run
gem build and
gem install command in the gem's local directory.
When using Homebrew Tap, it's quite hard to install an older or specific version of Homebrew package.
It took me awhile to run some tests before I found the solution (see below).
If you are facing the same problem, you can use my script below to solve the problem.