rails3 / mongoid / heroku / mongohq

717 views Asked by At

After quite a bit of struggle i manage to have my rails 3.2 app running on heroku.

running rails 3.2 / mongoid app on heroku fails

I have change from mongolab to mongohq as the app was crashing all the time after connecting it to mongolab.

It is now stil running (fingers crossed) But when I do heroku mongo:push to transfer the database, nothing get moved over to mongohq

Anybody has a clue?

here is my config.yml

development:
  host: localhost
  database: salsacaribecouk_development

test:
  host: localhost
  database: salsacaribecouk_test

# set these environment variables on your prod server
production:
  uri: <%= ENV['MONGOHQ_URL'] %>
  # slaves:
  #   - host: slave1.local
  #     port: 27018
  #   - host: slave2.local
  #     port: 27019

Cheers

2

There are 2 answers

1
Jason McCay On

Can you verify that you have the database you want to transfer to MongoHQ running locally on your machine with no auth turned on? Also, do you have Pedro's gem installed?

https://github.com/pedro/heroku-mongo-sync

0
shinnc On

https://github.com/pedro/heroku-mongo-sync#config

The plugin assumes your local mongo db is running on your localhost with the standard settings (port 27017, no auth). It will use a database named after the current Heroku app name.

You can change any of these defining the URL it should connect to, like:

export MONGO_URL = mongodb://user:pass@localhost:1234/db

Make sure your database name is exactly same with the application's name on heroku, else change the environment variable using the method above.