ruby on rails - Assigning an exception to a variable in pry -


So I'm trying to use pry to debug a method_missing in my Rail app : [5] pry (# & lt; Travel Agreement & gt;) & gt; E-name: Undefined local variables or # & lt; Method 'E' for Travel: Travel: 0x007fa3f30d13c8 & gt;

This is my code

  21: define_method (save_method) Do 22: If "@ # {method_name}" exists? 23: Start 24: self.send ("# {attribute} =", time .pars (instance_variable_get ("@ # {method_name}"))) 25: rescue = & gt; E = & gt; 26: binding.pry    

You always use the last exception through the global variable Can $! . See if your breakpoint works. It's possible that you have a breakpoint set elsewhere, and are actually debugging the wrong line.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -