The solution was to specify
gem 'mongoid', github: 'mongoid/mongoid'
in gem Gemfile
and
gem 'mongoid', '~>4.0.0.beta1', github: 'mongoid/mongoid'
Rails Gemfile
.
gem.gemspec
has to have the following entries:
spec.add_runtime_dependency 'mongoid'
spec.add_runtime_dependency 'bson'
spec.add_runtime_dependency 'bson_ext'