नामक सत्र के लिए कोई कॉन्फ़िगरेशन नहीं मिला, मैंने रेल्स माउंटेबल ऐप बनाया है और 'मोंगोइड' और 'आरएसपीसी' मणि जोड़ा है। करने के लिए spec_helper.rb
सब कुछ सामान्य काम करता है जब मैं Mongoid.load!(Rails.root.join("config", "mongoid.yml"))
पंक्ति जोड़ेंरेल इंजन + Mongoid: 'डिफ़ॉल्ट'
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.
: अगर मैं अपने चश्मा चलाने का प्रयास अब मैं निम्नलिखित त्रुटि मिलती है।
यह क्यों है और मैं सामान्य रेल ऐप की तरह कार्यक्षमता कैसे प्राप्त कर सकता हूं जहां मुझे लोड फ़ंक्शन को कॉल करने की आवश्यकता नहीं है?
mongoid.yml
development:
sessions:
default:
database: dummy_development
hosts:
- localhost:27017
options:
options:
test:
sessions:
default:
database: dummy_test
hosts:
- localhost:27017
options:
consistency: :strong
max_retries: 1
retry_interval: 0
संस्करण:
gem 'rails', '~> 3.2.12'
gem 'mongoid', '~> 3.1'
gem 'rspec-rails', '~> 2.13'
आप अपने mongoid.yml फ़ाइल को पोस्ट कर सकते हैं? –