Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Kernel#require_relative

(::String feature) -> bool
require_relative(string) → true or false

Ruby tries to load the library named string relative to the directory containing the requiring file. If the file does not exist a LoadError is raised. Returns true if the file was loaded and false if the file was already loaded before.

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