try this

[1,2,3].each {|x| begin p x, x/0; rescue; end; }

On 7 March 2017 at 19:29, Robert Klemme <shortcutter / googlemail.com> wrote:

> On Tue, Mar 7, 2017 at 7:29 PM, Die Optimisten
> <inform / die-optimisten.net> wrote:
>
> > begin [1,2,3].each {|x| p x, x/0 };  rescue; end
> > # this ends after the first error, I want it to continue till the end,
> > ignoring all errors inside
> > What to change, what is wrong?
>
> The placement of "rescue". ;-)
>
> robert
>
> --
> [guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
> - without end}
> http://blog.rubybestpractices.com/
>
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>