Re: [mongoid] Rails Engine + Mongoid: No configuration could be found for a session named 'default'

Visto 1.858 veces
Saltar al primer mensaje no leído

Arthur Neves

no leída,
14 mar 2013, 16:16:2914/3/13
a mon...@googlegroups.com
I just replied on stackoverflow:

-- 
Arthur Nogueira Neves
@arthurnn

On Tuesday, 12 March, 2013 at 11:00 AM, Moritz Winter wrote:

Info: this is a crosspost from http://stackoverflow.com/q/15354936/745359

I've created a Rails Mountable App and added 'mongoid' and 'rspec' gem's. If I try to run my specs now I get the following error:

Mongoid::Errors::NoSessionConfig:  
Problem:
  No configuration could be found for a session named 'default'.
Summary:
  When attempting to create the new session, Mongoid could not find a session configuration for the name: 'default'. This is necessary in order to know the host, port, and options needed to connect.
Resolution:
  Double check your mongoid.yml to make sure under the sessions key that a configuration exists for 'default'. If you have set the configuration programatically, ensure that 'default' exists in the configuration hash.

When I add the Mongoid.load!(Rails.root.join("config", "mongoid.yml")) line to spec_helper.rb everything works normal.

Q: Why is that? And how can I get the functionality like in a normal Rails app where I don't need to call the load function?

Versions:

gem "rails", "~> 3.2.12"
gem 'mongoid', '~> 3.1'
gem 'rspec-rails', '~> 2.13'

--
 
---
You received this message because you are subscribed to the Google Groups "Mongoid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoid+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos