rspec给出错误Moped :: Errors :: ConnectionFailure

时间:2012-11-16 14:55:14

标签: rspec mongoid moped

当我运行测试rspec时,我收到错误

1) Nimba::Storages DropboxStorages returns http success
 Failure/Error: Unable to find matching line from backtrace
 Moped::Errors::ConnectionFailure:
   Could not connect to a primary node for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>

我不知道为什么会出现这个错误?

谢谢..

1 个答案:

答案 0 :(得分:0)

通过向spec / spec_helper.rb添加行来解决问题

DatabaseCleaner.orm = "mongoid"