Can't run examples in #2

fuJiin opened this Issue May 11, 2010 · 5 comments


None yet

2 participants


I'm pretty new to this. But when I try to run the examples in the readme, I get the following error:

/gems/light_mongo-0.4.0/lib/document/serialization/hash_serializer.rb:58:in `rescue in natively_embeddable?': uninitialized constant Mongo::InvalidDocument (NameError)

I can provide the full-trace and my code if you're interested, but maybe I'm just doing something incredibly stupid. Any ideas what's wrong? I'm using Ruby 1.9.


Hi there.

I've not fully tested LM under 1.9, could you tell me specifically which example exploded?


It's blowing up for all of them. The problem is when you call save on the object.

I have the following:

LightMongo.database = "mydb"

class Person
  include LightMongo::Document

person =
  :first_name => "Bruce",
  :last_name => "Lee",
  :age => "dead"

ap Person.find.first

If I take out the code will run fine, returning an empty array of Person objects. But if I try to save it, or change the code to person = Person.create() it will break.

I've also checked the console and the database "mydb" exists.


Okay so this may or may not be a direct issue with 1.9, but it's definitely an issue with the ruby mongo driver.

There was recently a 1.0 release which breaks a few bits and pieces, and is going to be more than a five minute fix.

I would recommend using mongo gem version 1.19.1 and ruby 1.8.6 until I can do some work to make these more flexible.


Whoops, that's 0.19.1.


Okay will do. Keep me updated when you release the next version of light_mongo. I think it's a great idea.

@fuJiin fuJiin closed this Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment