I have found that I have no problem using require
to load something like the Sinatra web framework, but I can\'t seem to use require
to load my own
The current directory (relative to the main ruby file) is not part of the load paths (the set of paths that require
looks in). So you either need to add it to the load path (best done by invoking ruby as ruby -I. test1.rb
), by using require "./test2.rb"
or by using require_relative "test2.rb"
, which requires files relative to the directory of the file.