TL;DR:

Don't run bundle within an existing git repository. Weird things will happen without any error messages.

Original Question:

I've built a gem by adapting the steps in this tutorial:

http://net.tutsplus.com/tutorials/ruby/gem-creation-with-bundler/

As a final step, I've run gem build .gemspec

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.

I don't know how to start debugging this...how does bundler/gem build decide which files to include in the gem?

Edit:

My workflow is:

gem build <project_name>.gemspec
gem unpack <project_name>
=> confirm file does not exist in <unpacked>/lib/

gem install <project name>
=> confirm file structure in ~/home/stefan/.rvm/... contains gem, but does not contain desired file

Edit 2 / Resolution:

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.

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 inside the original repository, which didn't complain, but was probably the reason for the weirdness.

Edit
Report