0

Trying to add Mongodb to an existing app. And I'm getting this error. Not sure how to resolve it let alone understand it.

This comes from me trying to load up the homepage, and Devise is also making a call as so :

  1: .grid_24
  2:   .center-stuff
  3:     - if user_signed_in?
  4:       = link_to 'Begin Lesson', esson_path, class: 'button-green'
  5:     - else
  6:       %p Welcome :)

The error

ActionView::Template::Error (undefined method `schema_cache' for #<Mongo::Connection:0x007f89a7247dd0>):

My user.rb file

class User < ActiveRecord::Base
  include MongoMapper::Document         

my initializer

require 'mongo_mapper'
MongoMapper.connection = Mongo::Connection.new
MongoMapper.database = "ai_project-#{Rails.env}"
4

1 回答 1

1

用户模型不应扩展 ActiveRecord。

删除< ActiveRecord::Base,你应该很高兴

于 2012-06-30T16:25:32.253 回答