1

このエラーの取得

cannot load such file -- mongoid

RSpec テストを実行しようとしたとき。

別の端末で mongo を実行しています ( mongod)

ルビー2.0で

gem 'moped'とdを含めようとしましbundleたが、同じエラーが発生しました。

このエラーを修正してテストを実行する方法を見つけようとしています。

これは、私が分岐して更新しようとしているオープンソース プロジェクト用です。

テストは次のように始まります。

require 'spec_helper'

begin
require 'will_paginate/mongoid' # <-- this is the issue
rescue LoadError => error
  warn "Error running Sequel specs: #{error.message}"
  mongoid_loaded = false
else
  Mongoid.database = Mongo::Connection.new.db('will_paginate_test')

  class MongoidModel
    include Mongoid::Document
  end 

  mongoid_loaded = true
end

describe...

コメントアウトしましrequire 'will_paginate/mongoid'たが、その後取得しましたuninitialized constant Mongoid (NameError)

4

0 に答える 0