in HOME/path_test/ I have:
load_test.rb:
require \'yaml\' cnf = YAML::load(File.open(\'config.yml\')) puts cnf[\'Hello\']
config.ym
You should get path of the current file by:
cnf = YAML::load_file(File.join(File.dirname(File.expand_path(__FILE__)), 'config.yml'))
EDIT:
Since Ruby 2.0 you can simplify that and use:
cnf = YAML::load_file(File.join(__dir__, 'config.yml'))