ruby - Require 'cannot load such file'. Pushed my directory into the $: array -
i solved problem through
require_relative require './whateverfileiplannedtorequire' load 'whateverfileiplannedtorequire' but trying require work without ./ @ beginning advertised in the beginning ruby book. hoped pushing cwd $: array fix this, didn't. how manage require work shown in book?
use
$:.unshift "/my/directory" for example add current directory (where source file is) load path:
$:.unshift file.expand_path(file.dirname(__file__))
Comments
Post a Comment