title: binding.pry in Rails View: NameError: undefined local variable or method
body: <p>I use Rails 4 with the gems byebug, pry-rails, pry-byebug, pry-stack_explorer.</p>
  
  <p>When i replace in a view file:</p>
  
  <pre><code>  &lt;td class="subtotal"&gt;&lt;%= order.display_item_total %&gt;&lt;/td&gt;
  </code></pre>
  
  <p>with</p>
  
  <pre><code>  &lt;td class="subtotal"&gt;&lt;%= binding.pry %&gt;&lt;/td&gt;
  </code></pre>
  
  <p>and type inside the console where the rails server process is running and the execution stopped at the pry breakpoint:</p>
  
  <pre><code>order.inspect
  </code></pre>
  
  <p>i get the error message:</p>
  
  <pre><code>NameError: undefined local variable or method `order' for #&lt;ActionView::OutputBuffer:0x007fdf13d99bb8&gt;
  </code></pre>
  
  <p>When i replace binding.pry with order.inspect i get the object info of order in the browser.</p>
  
  <p>I would expect that I should be able to get the object order inside the pry session in the console. What am I doing wrong?</p>
  
  <p>EDIT:
  In the beginning of the console output:</p>
  
  <pre><code>From: /Users/standardnerd/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/string/output_safety.rb @ line 166 ActiveSu
  pport::SafeBuffer#safe_concat:
  
      165: def safe_concat(value)
   =&gt; 166:   raise SafeConcatError unless html_safe?
      167:   original_concat(value)
      168: end
  </code></pre>
  
  <p>Does this impact the scope of the variables?</p>