When you require sth
, Ruby searches the source in $LOAD_PATH
($:
). For security concern, the current working directory is not included in $LOAD_PATH
. You can either explicitly add the directory into $LOAD_PATH
$: << File.dirname(__FILE__)
require 'churn'
or use the Kernel#require_relative
to require a module based on the same directory:
require_relative "churn"