You're invoking a method on a nil object causing a runtime error (i.e the n=
il class does not define a method 'traverse'). Try checking the object firs=
t before calling the method. Something simple like: unless node.nil? should=
 do it. In 7stud's example, the variable 'data' is nil so calling a method =
on it, in this case 'each', raises the same error.