Ruby 'require' error: cannot load such file

后端 未结 13 1510
抹茶落季
抹茶落季 2020-12-02 05:07

I\'ve one file, main.rb with the following content:

require \"tokenizer.rb\"

The tokenizer.rb file is in the same directory and it

13条回答
  •  误落风尘
    2020-12-02 05:59

    I would recommend,

    load './tokenizer.rb'
    

    Given, that you know the file is in the same working directory.

    If you're trying to require it relative to the file, you can use

    require_relative 'tokenizer'
    

    I hope this helps.

提交回复
热议问题