これは、Ruby ではなく、マシンや MySQL の構成に関係している可能性があると思います。MySQL が予約できるメモリ量を確認してください。これらのパラメータは、データベースの初期化ファイルまたは起動ファイルにある必要があります。残念ながら、MySQL でこれらのファイルを探す場所が正確にはわかりません。
構成ファイルにタイプミスをしたため、Postgres で同様のエラーが発生しました。Postgres では、探しているファイルは次のようになります。MySQL とあまり変わらないはずです。
#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------
# - Memory -
!!!THIS is the field you want to change!!!
shared_buffers = 28MB # min 128kB, default 28
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
# (change requires restart)
# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
# It is not advisable to set max_prepared_transactions nonzero unless you
# actively intend to use prepared transactions.
#work_mem = 1MB # min 64kB
#maintenance_work_mem = 16MB # min 1MB
#max_stack_depth = 2MB # min 100kB