`require ': cannot load such a file - mongo (LoadError)

`require ': cannot load such a file - mongo (LoadError)

I don’t know why I get this error. All other gems that I use are working fine. The top of my rspec test looks like this:

require 'rubygems'
require 'spec_helper.rb'
require 'base64'
require 'json'
require 'bigdecimal'
require 'mysql2'
require 'mongo'

'mongo' however works in irb:

irb => require 'mongo'
true

When I use it in a script, it also works. Just not in my rspec testing. My file structure looks like this: automation / test / spec / lib / test_spec.rb Although it does not seem to matter where I run the test from. I also use RVM, but as I said, all the other stones work, so I do not think this is a problem.

To compare versions, here is a copy of my gems list:

bson (1.9.2)
bson_ext (1.9.2)
mongo (1.9.2)
rspec (2.14.1)
rspec-core (2.14.4)
rspec-expectations (2.14.0)
rspec-mocks (2.14.4, 2.14.1)
+4
1

, 'bundler/setup' , gem 'mongo' Gemfile, , .

+2

Source: https://habr.com/ru/post/1530081/


All Articles