There is no issue here at all.

a = [[1, 2, ,3, 4, 5]]

a.each do |x\
  x.each do |y|
    pp y
  end
  x.each do |z|
    pp z
  end
  pp x
end

Works perfectly fine. Are you certain your second for actually has any
items to iterate? Remove the first embedded each loop and make sure they
both work independent of each other before assuming the nesting in the
issue.

John

On Sat, Aug 10, 2019 at 2:43 PM <FreeKMan / protonmail.com> wrote:

> Issue #16096 has been reported by D1mon (Dim F).
>
> ----------------------------------------
> Misc #16096: each in each (multiple uses 'each')
> https://bugs.ruby-lang.org/issues/16096
>
> * Author: D1mon (Dim F)
> * Status: Open
> * Priority: Normal
> * Assignee:
> ----------------------------------------
> ``` ruby
> obj.each {|a|
>     a.some_method1.each {|b|
>         ... # comes here (enter)
>     }
>     a.some_method2.each {|c|
>         ... # does not enter here
>     }
> }
>
> # tried and that way. also does not go
> for a in obj
>     for b in a.some_method1
>         ... # comes here
>     end
>     for c in a.some_method2
>         ... # does not enter here
>     end
> end
> ```
>
> help solve the problem. I”Ēve been suffering for 2 days.
>
>
>
>
> --
> https://bugs.ruby-lang.org/
>
> Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
>
(supressed text/html)
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>