title: Missing File in Gem after Build
body: <p><strong>TL;DR:</strong></p>
  
  <p>Don't run bundle within an existing git repository.  Weird things will happen without any error messages.</p>
  
  <p><strong>Original Question:</strong></p>
  
  <p>I've built a gem by adapting the steps in this tutorial:</p>
  
  <p><a href="http://net.tutsplus.com/tutorials/ruby/gem-creation-with-bundler/" rel="noreferrer">http://net.tutsplus.com/tutorials/ruby/gem-creation-with-bundler/</a></p>
  
  <p>As a final step, I've run gem build .gemspec</p>
  
  <p>This succeeds, but when I install the gem I find the critical file, the one which contains my code, isn't in the gem.  Another file in the same (lib) directory, "version.rb", does exist in the gem.</p>
  
  <p>I don't know how to start debugging this...how does bundler/gem build decide which files to include in the gem?  </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>My workflow is:</p>
  
  <pre><code>gem build &lt;project_name&gt;.gemspec
  gem unpack &lt;project_name&gt;
  =&gt; confirm file does not exist in &lt;unpacked&gt;/lib/
  
  gem install &lt;project name&gt;
  =&gt; confirm file structure in ~/home/stefan/.rvm/... contains gem, but does not contain desired file
  </code></pre>
  
  <p><strong>Edit 2 / Resolution</strong>:</p>
  
  <p>I was finally able to get this working by committing all my code to a remote repository, creating a clean clone, and building the gem.  The new gem included all the required files.</p>
  
  <p>A bit of history...I originally created the code and committed it before thinking about making a gem (this is my first gem).  I then used bundle <em>inside</em> the original repository, which didn't complain, but was probably the reason for the weirdness. </p>