我将 Sinatra 应用程序上传到 heroku。在此之前,我在MongoHQ
那里安装了免费插件。但是,我从 heroku 收到一个错误:
Moped::Errors::ConnectionFailure - Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
这是我的 mongoid.yml
development:
sessions:
default:
database: my_db
hosts:
- localhost:27017
options:
timeout: 10
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
那么,为什么会这样呢?