title: Could not connect to a primary node for replica set
body: <p>I have a MongoDB running on a EC2 (AWS) instance where my production app is running from and everything seems fine. On the same db, I also have a development db which I use locally, however I had a problem with my Mac and got a new one. On the new one I cannot connect to the db using a command like: <code>rails c</code> and <code>User.count</code> as I get this error:</p>
  
  <pre><code>Moped::Errors::ConnectionFailure: Could not connect to a primary node for replica set #&lt;Moped::Cluster:70300606784060 @seeds=[&lt;Moped::Node resolved_address="127.0.0.1:27017"&gt;]&gt;
  </code></pre>
  
  <p>Yet the production app works fine without hiccups. This is only happening on my new local machine. And yes, I have checked whether the config on the EC2 security group but the security group is allowing my IP, which hasn't changed with the new machine. </p>
  
  <p>Any suggestions on what I might be missing?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here's my <code>mongoid.yml</code> file:</p>
  
  <pre><code>development:
    sessions:
      default:
        uri: mongodb://some_ip:some_port/production
    options:
      raise_not_found_error: false
  
  test:
    sessions:
      default:
        hosts:
          - localhost:27017
        database: mrc_test
    options:
      raise_not_found_error: false
  
  testing:
    sessions:
      default:
        uri: mongodb://some_ip:some_port/testing
    options:
      raise_not_found_error: false
  
  production:
    sessions:
      default:
        uri: mongodb://some_ip:some_port/production
    options:
      raise_not_found_error: false
  </code></pre>