{"id":653,"date":"2022-08-30T15:04:56","date_gmt":"2022-08-30T15:04:56","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/undefined-method-schema_cache-for-mongoconnection-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:04:56","modified_gmt":"2022-08-30T15:04:56","slug":"undefined-method-schema_cache-for-mongoconnection-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/undefined-method-schema_cache-for-mongoconnection-collection-of-common-programming-errors\/","title":{"rendered":"undefined method `schema_cache&#39; for Mongo::Connection-Collection of common programming errors"},"content":{"rendered":"<p>Trying to <em>add<\/em> Mongodb to an existing app. And I&#8217;m getting this error. Not sure how to resolve it let alone understand it.<\/p>\n<p>This comes from me trying to load up the homepage, and Devise is also making a call as so :<\/p>\n<pre><code>  1: .grid_24\n  2:   .center-stuff\n  3:     - if user_signed_in?\n  4:       = link_to 'Begin Lesson', esson_path, class: 'button-green'\n  5:     - else\n  6:       %p Welcome :)\n<\/code><\/pre>\n<p><strong>The error<\/strong><\/p>\n<pre><code>ActionView::Template::Error (undefined method `schema_cache' for #):\n<\/code><\/pre>\n<p><strong>My user.rb file<\/strong><\/p>\n<pre><code>class User &lt; ActiveRecord::Base\n  include MongoMapper::Document         \n<\/code><\/pre>\n<p><strong>my initializer<\/strong><\/p>\n<pre><code>require 'mongo_mapper'\nMongoMapper.connection = Mongo::Connection.new\nMongoMapper.database = \"ai_project-#{Rails.env}\"\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:11:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Trying to add Mongodb to an existing app. And I&#8217;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: &#8211; if user_signed_in? 4: = link_to &#8216;Begin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-653","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}