Kashiftufail
Kashiftufail

Reputation: 10885

How i can connect to MongoDB on heroku

enter image description here

Here is my mongoDB created on heroku.And below is my mongoid.yml setting for production.Everything is fine on local.

   production:
     sessions:
       default:
         uri: <%= ENV['MONGOHQ_URL']%>
         options:
           skip_version_check: true 
           safe: true

Where is problem can anyone please help

Upvotes: 0

Views: 136

Answers (1)

Alon Burg
Alon Burg

Reputation: 2550

Seems like you selected to use MongoLAB but are using MongoHQ variables. Just change the ENV['MONGOHQ_URL'] to ENV['MONGOLAB_URI'].

Example:

production:
  sessions:
    default:
      uri: <%= ENV['MONGOLAB_URI'] %>
      options:
        consistency: :strong
  options:
    allow_dynamic_fields: false
    identity_map_enabled: true
    include_root_in_json: false

Upvotes: 1

Related Questions