I have a Rails application on Heroku that is supposed to connect to a MongoLab database. My issue is any command that attempts to access the database in any way results in
undefined method `[]' for nil:NilClass
This includes seeding the db. My mongoid.yml is as follows
production:
sessions:
default:
uri: <%= ENV['MONGOLAB_URI'] %>
development:
sessions:
default:
database: dev_database
hosts:
- localhost:27017
This mongoid.yml works fine for another ROR application I have using the same version of Mongoid (3.0.1), so I am unsure why it is giving me issues here. MONGOLAB_URI is defined in the environment. I'm fairly certain the issue must be with the database connection, but I am unsure what. Any ideas how to resolve this issue?
EDIT:
I just tried this to no avail as well...
production:
sessions:
default:
uri: <%= ENV['MONGOLAB_URI'] %>
options:
skip_version_check: true
safe: true