Mongoid::Errors::DocumentNotFound raise_not_found_error

your structure of yml is wrong

has to be -

development:
  sessions:
    options:
      #raise_not_found_error has to be not here but see below
  options: #strictly 2 spaces before
    raise_not_found_error: false #strictly 4 spaces before not 6

so, raise_not_found_error parameter has to be child of development>options, not development>sessions>options


For me even correct indenting didn't work, what did is to create an initializer file called mongoid.rb in config/initializers/ and put this into it

Mongoid.raise_not_found_error = false