Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9031051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:38:17+00:00 2026-06-16T07:38:17+00:00

I had create two environment for development on local machine and staging on heroku.

  • 0

I had create two environment for development on local machine and staging on heroku.

Here my ‘mongoid.yml’:

development:
  sessions:
    default:
      database: mydb_development
      hosts:
        - localhost:27017
staging:
  sessions:
    default:
      database: mydb_staging
      uri: <%= ENV['MONGOLAB_URI'] %>

Mongoid works properly on local machine, but after heroku deployment I take next error:

/app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.14/lib/mongoid/config/validators/session.rb:81:in `validate_session_uri':  (Mongoid::Errors::MixedSessionConfiguration)
2012-12-25T10:12:44+00:00 app[web.1]: Problem:
2012-12-25T10:12:44+00:00 app[web.1]:   Both uri and standard configuration options defined for session: 'default'.
2012-12-25T10:12:44+00:00 app[web.1]: Summary:
2012-12-25T10:12:44+00:00 app[web.1]:   Instead of simply giving uri or standard options a preference order, Mongoid assumes that you have made a mistake in your configuration and requires that you provide one or the other, but not both. The options that were provided were: {"database"=>"xxxxx_staging", "uri"=>"mongodb://xxxxx:xxxxx@xxxxx.mongolab.com:37587/xxxxxx"}.
2012-12-25T10:12:44+00:00 app[web.1]: Resolution:
2012-12-25T10:12:44+00:00 app[web.1]:   Provide either only a uri as configuration or only standard options.

What phrase ‘Provide either only a uri as configuration or only standard options’ means?
How to configure mongoid for development and staging properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:38:18+00:00Added an answer on June 16, 2026 at 7:38 am

    Remove this line:

    database: mydb_staging
    

    as the database name is present in the URI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, here is how to re-create the problem had: Create a new project, using
I had create a two int type list and assign the items that are
Had a simple question. With iCloud, if you create two apps, are you able
I want to create two users on my MySQL test database, One with read-only
I started two days ago to set up an SVN environment on my local
i had created a class with two properties one of datetime datatype and other
So I had to create this splash page in a very short amount of
If I had to create a content inventory for a website that doesn't have
For this assignment I had to create my own string class. I initially wrote
So basically the assignment was we had to create a doubly linked list that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.