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

  • SEARCH
  • Home
  • 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 6850887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:10:48+00:00 2026-05-27T01:10:48+00:00

I have an app setup with Rails 3.1, Mongo 1.4.0, Mongoid 2.2.4. What I

  • 0

I have an app setup with Rails 3.1, Mongo 1.4.0, Mongoid 2.2.4.

What I am experiencing is this:

Mongo::ConnectionFailure: Failed to connect to a master node at localhost:27017

I’ve had this problem before, but it went away on a computer restart… this time it does not.
I don’t understand, I didn’t do anything. I just put my computer in sleep mode, went home and woke it up, then there it was.

Here is the output of sudo mongod

Fri Nov 25 21:47:14 [initandlisten] MongoDB starting : pid=1963 port=27017          dbpath=/data/db/ 64-bit host=xxx.local
Fri Nov 25 21:47:14 [initandlisten] db version v2.0.0, pdfile version 4.5
Fri Nov 25 21:47:14 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222
Fri Nov 25 21:47:14 [initandlisten] build info: Darwin erh2.10gen.cc 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Fri Nov 25 21:47:14 [initandlisten] options: {}
Fri Nov 25 21:47:14 [initandlisten] journal dir=/data/db/journal
Fri Nov 25 21:47:14 [initandlisten] recover : no journal files present, no recovery needed
Fri Nov 25 21:47:15 [websvr] admin web console waiting for connections on port 28017
Fri Nov 25 21:47:15 [initandlisten] waiting for connections on port 27017

And I am able to connect with mongoin terminal.
After 2 hours of Googling I hope the competence of SOs community are able to figure this out.
Please, if you need more information about my app-setup just ask.
Thanks!

  • 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-05-27T01:10:48+00:00Added an answer on May 27, 2026 at 1:10 am

    What you see is that the connection times out… that happens either after a long period of inactivity, or if you put your computer to sleep.

    You can change / increase the timeout value, but this way you can’t get rid of the connection timing out eventually.

    Some MongoDB drivers allow to set :timeout => false , but Mongoid seems to still have problems with that
    (see last 3 links in the list)

    Hope this helps.

    See also:

    Mongodb server goes down, how to prevent Rails app from timing out?

    MongoDB: What is connection pooling and timeout?

    https://github.com/mongodb/mongo-ruby-driver


    How can I query mongodb using mongoid/rails without timing out?

    http://groups.google.com/group/mongoid/browse_thread/thread/b5c94e7047b42f8a

    https://github.com/mongoid/mongoid/issues/455

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

Sidebar

Related Questions

I have a rails setup that is something like this. app/service/TestService.rb class TestService def
I have a Rails app that saves files in mongo. This works great and
All this weekend I have been trying to setup a Rails 3.0.4 app in
I have setup some simple associations in my rails app: resources :properties do resources
I have a link in my rails app setup to make an ajax request
I have a Rails 3.2 app setup with Devise. Everything works great except for
I have sunspot-rails setup on a Rails 3.1 app. I was wondering if there's
I have just recently setup my rails 3.2 app to use the carrierwave gem
I have a Rails 3 app with authentication setup using Devise with the registerable
I have a rails app, that is setup with the default test unit, how

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.