As of Ruby 1.9.2, the current directory, ".", was removed from the load path for security reasons. The load path is stored in the global variable "$:", which you can display by running the command 'ruby -e puts $:'
The effect of this change means the step on page 19, changing load "loadee.rb" to require "load" will fail with an error:
The effect of this change means the step on page 19, changing load "loadee.rb" to require "load" will fail with an error:
'require': cannot load such file -- loadee (LoadError)
The solution is to either add the current directory, './loadee', or use require_relative 'loadee'. I hope this helps anyone else who puzzled over that error.
Thank you for the post! I am working The Well Grounded Rubyist and was puzzled by this issue. This cleared it up in an instant.
ReplyDelete