amatsuda/active_decorator

SystemStackError(stack level too deep) caused by recursive method_missing

Opened this issue · 0 comments

I attempted to update my Ruby version from 2.7.7 to 3.0.5, and now I am encountering the following error when running RSpec:

Error Details

The error stack trace is as follows:

/home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/view_context.rb:20:in `view_context_stack': stack level too deep (SystemStackError)
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/view_context.rb:8:in `current'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:12:in `rescue in method_missing'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:6:in `method_missing'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:14:in `rescue in method_missing'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:6:in `method_missing'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:14:in `rescue in method_missing'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:6:in `method_missing'
	from /home/circleci/repo/vendor/bundle/ruby/3.0.0/gems/active_decorator-1.4.0/lib/active_decorator/helpers.rb:14:in `rescue in method_missing'
	 ... 9349 levels...
	from /home/circleci/.rubygems/gems/bundler-2.4.10/lib/bundler/friendly_errors.rb:115:in `with_friendly_errors'
	from /home/circleci/.rubygems/gems/bundler-2.4.10/exe/bundle:33:in `<top (required)>'
	from /home/circleci/.rubygems/bin/bundle:25:in `load'
	from /home/circleci/.rubygems/bin/bundle:25:in `<main>'

From reading the stack trace, it seems that:

  • The current method cannot be executed in lib/active_decorator/view_context.rb
  • The error handling in lib/active_decorator/helpers.rb is looping

I am unsure how to address this issue and would appreciate any guidance.

Environment Information

  • Ruby Version: 3.0.5
  • Rails Version: 6.1.7.3
  • Gem Version: 1.4.0

If anyone has any insights or suggestions, I would greatly appreciate your comments. Thank you in advance.