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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -