rails: Stack Level too deep (SystemStackError)

Steps to reproduce

rails plugin install git://github.com/ryanb/cancan.git rails g cancan:ability

Expected behavior

Tell us what should happen

This should create a ability file for cancan in my ror app

Actual behavior

`/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:90:` `warning:` `already` initialized constant FileUtils::VERSION
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:92: warning: previous definition of VERSION was here
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1188: warning: already initialized constant FileUtils::Entry_::S_IF_DOOR
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1267: warning: previous definition of S_IF_DOOR was here
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1446: warning: already initialized constant FileUtils::Entry_::DIRECTORY_TERM
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1541: warning: previous definition of DIRECTORY_TERM was here
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1448: warning: already initialized constant FileUtils::Entry_::SYSCASE
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1543: warning: previous definition of SYSCASE was here
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1501: warning: already initialized constant FileUtils::OPT_TABLE
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1596: warning: previous definition of OPT_TABLE was here
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1555: warning: already initialized constant FileUtils::LOW_METHODS
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1650: warning: previous definition of LOW_METHODS was here
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1562: warning: already initialized constant FileUtils::METHODS
/usr/local/lib/ruby/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1657: warning: previous definition of METHODS was here
WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.8.0
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
Traceback (most recent call last):
	5368: from bin/rails:4:in `<main>'
	5367: from bin/rails:4:in `require'
	5366: from /usr/local/lib/ruby/gems/2.5.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
	5365: from /usr/local/lib/ruby/gems/2.5.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	5364: from /usr/local/lib/ruby/gems/2.5.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:50:in `generate'
	5363: from /usr/local/lib/ruby/gems/2.5.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
	5362: from /usr/local/lib/ruby/gems/2.5.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:142:in `require_application_and_environment!'
	5361: from /usr/local/lib/ruby/gems/2.5.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
	 ... 5356 levels...
	   4: from /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
	   3: from /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
	   2: from /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
	   1: from /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-4.2.1/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>': stack level too deep (SystemStackError)

System configuration

Rails version: Rails 4.2.1 Ruby version: Ruby 2.5.1p57

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@charlietag, it is actually still the issue, i’ve just tried.

But I found a work around which allows you to update the fileutils gem (a default gem) to the latest version and get rid of the warning by using --default option when you update the gem.

gem update --default

hope it helps.

Cheers

@foxmuldercp I have the same issue. I think it’s ruby 2.5 issue. fileutils move to gem. originally it’s under ruby stdlib.

$ gem list |grep fileutils
fileutils (1.1.0, default: 1.0.2)

$ gem uninstall fileutils

$ gem list |grep fileutils
fileutils (default: 1.0.2)

will fix this issue. But I would like my gem update to latest version.

Anyone has any idea??

Or… the best solution is using ruby 2.4.1…?

@charveasna You’re right… issue still exists… no matter how I install ruby 2.5.1…

Your Rails version is quite old, Ruby 2.5 support Rails 4.2.8+, the current stable is Rails 5.2. upgrade it with gem upgrade rails