title: Local Gem Path For Development And Remote Git Repo For Production
body: <p>I have a gem I'm working on locally which is used by a project.</p>
  
  <p>If I specify the gem's location using <code>path</code> in the , I can make a change and the project picks up the fresh code:</p>
  
  <pre><code>gem 'example', :path =&gt; "~/path/to/gems/example"
  </code></pre>
  
  <p>However, when I push to Heroku, bundling fails because Heroku can't access the gem source on my local machine.</p>
  
  <p>So I can push the gem source to a remote repo and point the gem source there:</p>
  
  <pre><code>gem 'example', :github =&gt; 'example/example', :branch =&gt; 'example_feature'
  </code></pre>
  
  <p>However I now need to push changes to this repo, then update the gem to get the fresh changes in my project:</p>
  
  <pre><code>$ cd ~/path/to/gems/example
  $ git c -a -m "Update gem"
  $ git push origin example_feature
  $ cd ~/path/to/projects/project
  $ gem update example
  </code></pre>
  
  <p>I can make this slightly less painful by setting a local override to my local repo:</p>
  
  <pre><code>$ bundle config local.example ~/path/to/gems/example
  </code></pre>
  
  <p>But I still need to add changed files to git, commit, then <code>$ gem update example</code> every time I change the gem source if I want fresh changes in my project.</p>
  
  <p><strong>Is there any way to have my project pick up local changes automatically (as it does when I use <code>path</code>), but still use the remote repo in production?</strong></p>