Problema de tablas de datos con MongoID, Rails 3.1

I am using a datatables gem ( https://github.com/potatosalad/mongoid-data_table ) which supports MongoID, But exception is raising from following code

format.json do
    render :json => Game.to_data_table(self)
end

Game.to_data_table(self)


INTERNAL ERROR!!! undefined method `page' for #<Array:0xb38d7bc>
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/mongoid-2.2.5/lib/mongoid/criteria.rb:369:in `method_missing'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/bundler/gems/mongoid-data_table-23283e37979c/lib/mongoid/data_table/proxy.rb:47:in `collection'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/bundler/gems/mongoid-data_table-23283e37979c/lib/mongoid/data_table/proxy.rb:263:in `method_missing'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:47:in `block in execute'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:19:in `run_with_binding'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:46:in `execute'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:280:in `one_cmd'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:261:in `block (2 levels) in process_commands'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:260:in `each'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:260:in `block in process_commands'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:253:in `catch'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:253:in `process_commands'
    /home/naveed/.rvm/gems/ruby-1.9.2-p290@rails3/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:173:in `at_line'
    (eval):5:in `block in at_line'
    <internal:prelude>:10:in `synchronize'
    (eval):3:in `at_line'

These are my mongo gems

gem 'mongo'
gem "mongoid", "~> 2.1"
gem 'bson', '= 1.4.0'
gem 'bson_ext', '= 1.4.0'

preguntado el 02 de febrero de 12 a las 10:02

1 Respuestas

I know that at one point there was a problem with the bson 1.4.0 gem and they actually revoked it and then put a new one back out. Perhaps try upgrading bson y la bson_ext gems. You can remove the mongo gem from the Gemfile, as it is a dependency for mongoid. Likewise, you can remove the bson gem from your Gemfile since it is a dependency for mongo (which is a dependency for mongoid). Also remove the version specification for the bson_ext gem. Then do bundle update bson y la bundle update bson_ext. See if that fixes it.

Respondido 02 Feb 12, 22:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.