4

I uploaded a Sinatra app to heroku. Before that, I installed the free MongoHQ addon there. However, I have an error from heroku:

Moped::Errors::ConnectionFailure - Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>

Here is my mongoid.yml

development:
  sessions:
    default:
      database: my_db
      hosts:
        - localhost:27017
      options:
        timeout: 10
production:
  sessions:
    default:
      uri: <%= ENV['MONGOHQ_URL'] %>

So, why is it happening?

Alan Coromano
  • 24,958
  • 53
  • 135
  • 205

1 Answers1

0

If you run heroku config you will see if heroku has added a MONGOHQ_URL which your mongoid.yml references. The other possiblity is you haven't set your RACK_ENV=production via heroku config:add RACK_ENV=production

Can you show us the output of running heroku config?

robbie613
  • 675
  • 1
  • 10
  • 8