Why does Ruby 1.9.2 remove “.” from LOAD_PATH, and what’s the alternative?

It was deemed a “security” risk.

You can get around it by using absolute paths

File.expand_path(__FILE__) et al

or doing

require './filename' (ironically).

or by using

require_relative 'filename'

or adding an “include” directory

ruby -I . ...

or the same, using irb;

$irb -I .

Leave a Comment