Pry: show me the stack

To do this without any pry plugins (I was having troubles with pry-stack_explorer), just look at caller.

I actually look for my project name to filter out all the irrelevant rails stack items. For example, if my project name were archie I’d use:

caller.select {|line| line.include? "archie" }

Which gives me the stack trace I’m looking for.

A shorter way would be:

caller.select {|x| x["archie"] }

Which works just as well.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)