ryanong/mongoid_spacial — Issue #19: dont work, but no reason
Author: geraudmathe
Created: 2012-02-02 10:02:41+00:00
State: open

Hi,

I'm having a strange issue, ive already ran

rake db:mongoid:create_indexes

but when i try to use spacial functions (any of them, like geo_near, ;field.where([]) ), i always get this error ;

Mongo::OperationFailure: can't find special index: 2d for: { location: { $near: [ 37.761523, -122.423575 ] } }

here's my model

class Place

include Mongoid::Document
include Mongoid::Spacial::Document

field :name,type: String
field :street,type: String
field :postal_code,type: String
field :city,type: String
field :location, type: Array, spacial:true
has_many :parties

end

Dont know what to do , i've already used this gem in production with no trouble , but i can't find how this error is thrown.

FYI, i'm using ruby-1.9.3, rails 3.1, mongo 2.0.2

thanks