MongoDB initialization error in Rails

Posted by rube_noob on Stack Overflow See other posts from Stack Overflow or by rube_noob
Published on 2010-06-09T09:18:22Z Indexed on 2010/06/09 9:22 UTC
Read the original article Hit count: 314

I have an initialization script to set up my MongoDB connection in the config/initialization directory.

It is my understanding that these initializers run after all of the plugins are initialized.

The problem I am having is that when a particular plugin I am using is initialized, it tries to access the mongodb before I have set it up.

I get this error:

   uninitialized class variable @@database_name in MongoMapper

My question is: Where can I initialize Mongodb that will run after the mongodb gem has been loaded and before any of the plugins are initialized?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about initialization