2

I have a Sinatra and Rails 3 applications. Applications were created independently and are hosted in 2 separate Heroku instances. So I need a share one MongoHQ database to both applications. How can I do it? Any idea?

Thanks.

Zeck
  • 6,433
  • 21
  • 71
  • 111

1 Answers1

3

It's really easy.

In the application that has the MongoHQ database look at the output of heroku config - you're looking for the entry MONGOHQ_URL.

All you need do is on the other application set a similar config variable to the same value as displayed from the the first application and then use it as ENV['MONGOHQ_URL'] in your second application.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
  • Thanks you for educate me. :) I'm inserted Sinatra application into Rails 3 application. So there's no need to share a database for me. – Zeck Feb 04 '12 at 16:23