Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Rails app: NoMemoryError: Too deeply nested

Open
#204 3 comments 9 reactions 0 assignees View on GitHub

@artofhuman is already working on this.

Since Mar 22, 2025.

  • #338 by @artofhuman — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rails, ruby
Domain
backend

Research direction

Start by locating the OJ_OPTIONS configuration referenced in the issue and inspect the existing serialization tests. Check whether the proposed compat mode and use_as_json setting reproduce or prevent the nested NoMemoryError, then run the relevant test suite; done means the Rails serialization path avoids the error without regressions.

Written by the indexing model from the issue text.

Description

When using Ruby on Rails I'm running into "NoMemoryError: Too deeply nested." with OJ's serialization within this gem. The suggested solution worked if I edited the OJ 'mode' to 'compat' and added the 'use_as_json' flag as follows:

    OJ_OPTIONS = {
      mode: :compat,
      # use ruby's built-in serialization.  If nil, OJ seems to default to ~15 decimal places of precision
      float_precision: 0,
      use_as_json: true
    }.freeze

The fact that no one else runs into this makes me wonder if maybe there is something about Rails specifically that is causing this though haven't tracked it down. If it's possible to modify these OJ options for everyone and tests still pass it could be suggested as a solution.

I'm happy to offer a PR if it would be accepted.

Dominant language
Ruby
Stars
287
Forks
113
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coinbase/temporal-ruby

All issues in coinbase/temporal-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.