`require': cannot load such file - Ruby + Rspec -


im having trouble loading dependences in ruby app (non-rails).

its folder tree

project

  -> bin   -> lib     -> modules       -> file1.rb       -> file2.rb   -> spec     -> file2_spec.rb 

my file is

require 'file1'  module file2 end 

my spec is

require 'spec_helper' require_relative '../lib/modules/file2' 

in error message shows

rspec spec/query_util_spec.rb /home/gustavo/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- file1 (loaderror)

i tried add "require_relative" file1 in spec , still not work.

i'll grateful give me directions

change file2.rb this:

require './file1'  module file2 end 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -