lundi 7 février 2022

rails console cannot load such file but with one letter capitalized it works?

ruby version: 2.7.3

Hi! I am very puzzled...

I have a file path company/service/v1/my_proto_pb.rb. When I tried to require it in rails console it gives the cannot load such file error:

2.7.3 :005 > require "company/service/v1/my_proto_pb"
Traceback (most recent call last):
/usr/local/rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:34:in `require': cannot load such file -- company/service/v1/my_proto_pb (LoadError)

HOWEVER when I capitalize the letter v to V it works:

2.7.3 :006 > require "company/service/V1/my_proto_pb"
 => true

But the .rb and .rbi file both exist in the v1 folder. Why??? I cannot change the letter in code as it's auto-generated. Where exactly does the require look for and how can i check if what's being required exists or not?

Thank you!

Aucun commentaire:

Enregistrer un commentaire