title: ActionView::Template::Error (Cannot visit ThreadSafe::Array): - Production
body: <p>I have an application that was running great in development, but when I deployed it, I keep getting this error when I access my cart controller:</p>
  
  <p>ActionView::Template::Error (Cannot visit ThreadSafe::Array)</p>
  
  <p>it says that the error is in this line:</p>
  
  <pre><code>(&lt;%= @cart_items.count %&gt; itens)
  </code></pre>
  
  <p>Does anybody know how to solve it?</p>
  
  <p>EDIT: Here is the stack trace</p>
  
  <pre><code>I, [2016-01-05T21:45:14.679041 #4470]  INFO -- : Processing by 
  
  CartsController#show as HTML
  I, [2016-01-05T21:45:14.725732 #4470]  INFO -- :   Rendered carts/show.html.erb within layouts/application (4.7ms)
  I, [2016-01-05T21:45:14.725894 #4470]  INFO -- : Completed 500 Internal Server Error in 47ms (ActiveRecord: 1.9ms)
  F, [2016-01-05T21:45:14.727838 #4470] FATAL -- :
  ActionView::Template::Error (Cannot visit ThreadSafe::Array):
      22:   &lt;div class="panel-heading"&gt;
      23:     &lt;h3 class="panel-title"&gt;
      24:       &lt;span aria-hidden="true" class="glyphicon glyphicon-shopping-cart"&gt;&lt;/span&gt; Meu carrinho &lt;small&gt;&lt;% if @cart_items.present? %&gt;
      25:         (&lt;%= @cart_items.count %&gt; itens)
      26:         &lt;% end %&gt;
      27:       &lt;/small&gt;
      28:     &lt;/h3&gt;
    app/views/carts/show.html.erb:25:in `_app_views_carts_show_html_erb___1773486621924863592_30719520'
  </code></pre>
  
  <p>Thanks in advance!</p>