未初始化的常量Mongoid :: Spacial :: Document :: ClassMethods :: Mongo

时间:2013-03-02 13:05:11

标签: ruby-on-rails ruby mongoid

我正在尝试使用mongoid_spacial gem,这就是我的模型的样子:

class Place
    include Mongoid::Document
    include Mongoid::Spacial::Document

        field :name, :type => String

        field :source,            type: Array,    spacial: true
        field :mouth,             type: Array,    spacial: {lat: :latitude, lng: :longitude,    return_array: true }

       spacial_index :source

      end

错误是

   uninitialized constant Mongoid::Spacial::Document::ClassMethods::Mongo
   MONGOID: Attempted to constantize Property, trying without namespacing.
   MONGOID: Failed to determine model from app/models/property.rb:
   NameError:uninitialized constant Mongoid::Spacial::Document::ClassMethods::Mongo`

感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

升级至mongoid_spacial 0.2.17,修正a namespacing bug you're seeing