Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Kernel#require_relative

require_relative(string) → true or false

Ruby tries to load the library named string relative to the requiring file’s path. If the file’s path cannot be determined a LoadError is raised. If a file is loaded true is returned and false otherwise.

See also #require #select #readlines #set_trace_func also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0