I am new to Ruby and am trying to learn it. I am using the latest version of Ruby (2.4.1) and the interactive Ruby Shell.
I met a method childrenin the classroom Dir. I tried an example from the documentation :
Dir.children("testdir") #=> ["config.h", "main.rb"]
but it does not work, because I get the following message:
undefined method `children' for Dir:Class
What am I missing?
source
share