Specifying the same gem twice for development/test and production but different paths

Yes, there is a better way: First, have the gem as a git gem in all environments

gem :example_gem, :git => '[email protected]:foo/example_gem', :branch => :master #you need to set a branch

Then in your app's folder run

bundle config --local local.example_gem /path/to/gem

This will edit .bundle/config to set this option (make sure this file isn't checked into source control!) and tells bundler to get the gem from that path.

At the point when you are going to push your commits you have to be a little bit careful: if your app depends on not yet committed changes to the gem then clearly things will break. In addition as you commit to the repository for the example gem the rails app's Gemfile.lock will get updated. If you push a Gemfile.lock that references a commit that only exists in your copy of the example_gem repo then other users will be stuck.