title: Mongoid sessions not found
body: <p>Trying out a Sinatra | Mongoid 3. I run into the following error, whenever I attempt to save to the database.</p>
  
  <pre><code>Mongoid::Errors::NoSessionsConfig: 
  Problem:
   No sessions configuration provided.
  Summary:
  Mongoid's configuration requires that you provide details about each session that can be connected to, and requires in the sessions config at least 1 default session to exist.
  Resolution:
      Double check your mongoid.yml to make sure that you have a top-level sessions key with at least 1 default session configuration for it. You can regenerate a new mongoid.yml for assistance via `rails g mongoid:config`.
  
  Example:
   development:
      sessions:
       default:
          database: mongoid_dev
       hosts:
        - localhost:27017
  
  from /Users/rhodee/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/mongoid-3.0.13/lib/mongoid/sessions/factory.rb:61:in `create_session'
  </code></pre>
  
  <p>I've already confirmed the following:</p>
  
  <ul>
  <li>Mongoid.yml file is loaded</li>
  <li>The hash contains correct environment and db name</li>
  </ul>
  
  <p>Using pry the return value from the <code>Mongoid.load!</code> method returns:</p>
  
  <pre><code>=&gt; {"sessions"=&gt;
   {"default"=&gt;
   {"database"=&gt;"bluster",
   "hosts"=&gt;["localhost:27017"],
   "options"=&gt;{"consistency"=&gt;"strong "}}}}
  </code></pre>
  
  <p>If it's any help check, I've added the app.rb file and mongoid.yml file as well.</p>
  
  <p><strong>App.rb</strong></p>
  
  <pre><code>require 'sinatra'
  require 'mongoid'
  require 'pry'
  require 'routes'
  require 'location'
  
  configure :development do
   enable :logging, :dump_errors, :run, :sessions
   Mongoid.load!(File.join(File.dirname(__FILE__), "config", "mongoid.yml"))
  end
  </code></pre>
  
  <p><strong>Mongoid.yml</strong></p>
  
  <pre><code> development:
     sessions:
       default:
        database: bluster
        hosts:
          - localhost:27017
        options:
         consistency: strong 
  </code></pre>