From: Tony Montana Date: 2011-02-06T21:22:39+09:00 Subject: require does not work Hi fellas! I use ruby 1.9.2, and I try to force working the example from the book i'm reading "The well-grounded rubyist": #stacklike.rb module Stacklike def stack @stack ||= [] end def add_to_stack(obj) stack.push(obj) end def take_from_stack stack.pop end end #stack.rb require "stacklike" class Stack include Stacklike end s = Stack.new Both files under modules folder. When I running stack.rb I have the error: :29:in `require': no such file to load -- stacklike (LoadError) from :29:in `require' from modules/stack.rb:1:in `
' None of these methods does not work too: require "modules/stacklike" require "modules/stacklike.rb" But load "modules/stacklike.rb" works fine! I'm absolutely noob in ruby and any help is appreciated. -- Posted via http://www.ruby-forum.com/.