【问题标题】:rspec gives error Moped::Errors::ConnectionFailurerspec 给出错误 Moped::Errors::ConnectionFailure
【发布时间】:2012-11-16 14:55:14
【问题描述】:

当我运行测试 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">]>

我不明白为什么会出现这个错误?

谢谢..

【问题讨论】:

    标签: rspec mongoid moped


    【解决方案1】:

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

    DatabaseCleaner.orm = "mongoid"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-13
      • 1970-01-01
      • 2012-07-14
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      相关资源
      最近更新 更多