How does load/require/require_relative handle a file with no file extension?

前端 未结 1 1833
礼貌的吻别
礼貌的吻别 2021-01-19 23:05

I have been using a tutorial that uses require with a file that does not have a file extension.

i.e.:

onefile.rb:

   require \"secondfile\"


secon         


        
相关标签:
1条回答
  • 2021-01-20 00:05

    From the documentation:

    Ruby tries adding “.rb”, “.so”, and so on to the name until found.

    http://apidock.com/ruby/Kernel/require

    0 讨论(0)
提交回复
热议问题