Forum: Ruby on Rails MySql Memory Error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sean McGilvray (Guest)
on 2009-04-11 01:11
(Received via mailing list)
I am getting the following error when I try the following code.


  def index
    @stats = SubscriptionPayment.stats if params[:page].blank?
    @subscriptions = Subscription.paginate(:include => :account, :page
=> params[:page], :per_page => 30, :order => '')


<% @page_title = 'Subscriptions' %>
<% if @stats %>
  <h1>Revenue Summary</h1>
  <table id="stats">
      <th>Last Month</th>
      <td><%= number_to_currency(@stats[:last_month]) %></td>
      <th>Last 30 Days</th>
      <td><%= number_to_currency(@stats[:last_30]) %></td>
      <th>This Month</th>
      <td><%= number_to_currency(@stats[:this_month]) %></td>
<% end %>

<h1><%= @page_title %></h1>
<table id="subscriptions">
    <th>Next Renewal</th>
  <% @subscriptions.each do |subscription| %>
    <tr class="<%= 'expired' unless subscription.current? %>">
      <td><%= link_to(h(, [:admin,
subscription]) %></td>
      <td><%= number_to_currency(subscription.amount) %> <%= "(#
{})" if %></td>
      <td><%= subscription.created_at.strftime("%d %B %Y") %></td>
      <td><%= subscription.next_renewal_at.strftime("%d %B %Y") %></
      <td><%= subscription.state %></td>
  <% end %>

<%= will_paginate(@subscriptions) %>


ActiveRecord::StatementInvalid (Mysql::Error: Out of memory (Needed
2096048 bytes):

How do I get around this or fix the current statements?

Thank you,

This topic is locked and can not be replied to.