I’m running a rails application on EC2, and I’m using mongoHQ as DBMS. I’ve specified following values in mongoid.yml
defaults: &defaults
host: staff.mongohq.com
port: 10082
username: CodeMaster123
password: 00000000
development:
<<: *defaults
database: app-development
test:
<<: *defaults
database: app-box-test
But when I execute rails s it throws an error saying
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/mongo-1.4.0/lib/mongo/connection.rb:
526:in `connect': Failed to connect to a master node at localhost:27017(Mongo::ConnectionFailure)
Is there a way to check whether mongoid is reading mongoid.yml?
Edit:
If I use wrong port number then it show an error
Failed to connect to a master node at spd.mongohq.com:10092 (Mongo::ConnectionFailure)
It means that it ignore the the connection options specified in mongoid.yml and connects to localhost:27017. Why is it happening?
There were two files specifying DBMS details, I edited them and my application worked fine.