Bundle install error involving hash range errors

While running "bundle install" on a new Rails3.0.0.beta app on Ubuntu
9.10 / Ruby 1.8.7 with the following line in my Gemfile:

gem "mongoid", :git => "git://github.com/durran/mongoid.git", :branch
=> "prerelease"

I got the following error:

Installing mongoid (2.0.0.pre) from git://github.com/durran/mongoid.git
(at prerelease) /usr/lib/ruby/1.8/yaml.rb:389:in `hash': no implicit
conversion from nil to integer (TypeError)
        from /usr/lib/ruby/1.8/yaml.rb:389:in `quick_emit'

Patching /usr/bin/bundle with this fixed the issue:

require 'rubygems'
class Gem::Specification
  def hash
    # one way to produce a Fixnum hash
    super.hash
  end
end

Thanks to this link:
http://rubyforge.org/tracker/index.php?func=detail&aid=26958&group_id=126&atid=575

(I spent quite a while shaving this yak this morning, hopefully this
may save someone else that time.)

- John Lynch
john@rigelgroupllc.com