耙子流产了! SystemStackError:堆栈级别太深

时间:2018-06-22 14:20:06

标签: ruby-on-rails ruby-on-rails-4 heroku cloud9

SystemStackError:堆栈级别太深 部署到heroku时遇到问题。

我在此处张贴之前进行了搜索,并遵循了一些提示。

在config / application.rb中添加了预编译配置

class Application < Rails::Application
    config.i18n.default_locale = [ :en ]
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'
  config.assets.initialize_on_precompile = false
    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
  end
end

然后

$ RAILS_ENV=production bundle exec rake assets:precompile

$ git add -A
$ git commit -m .
$ git push heroku master

这是heroku推送的完整跟踪。

Bundle completed (17.33s)
       Cleaning up the bundler cache.
       Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
       The latest bundler is 1.16.2, but you are currently running 1.15.2.
       To update, run `gem install bundler`
-----> Installing node-v8.10.0-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       ** Invoke assets:precompile (first_time)
       ** Invoke assets:environment (first_time)
       ** Execute assets:environment
       ** Invoke environment (first_time)
       ** Execute environment
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
       rake aborted!
       SystemStackError: stack level too deep
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:124:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/cache/strategy/local_cache.rb:137:in `local_cache_key'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/cache/strategy/local_cache.rb:74:in `middleware'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/application/bootstrap.rb:65:in `block in <module:Bootstrap>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/config/environment.rb:5:in `<top (required)>'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/application.rb:276:in `require_environment!'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/railties-4.1.8/lib/rails/application.rb:389:in `block in run_tasks_blocks'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
       /tmp/build_dc2cd42e7f5a928ff12204be7d379467/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
       Tasks: TOP => environment
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

我发现了一些东西,并认为此问题就像方法调用重复。

但是,我无法弄清楚我需要修复哪个文件。

请给我一些提示。

谢谢,祝你有美好的一天!

哦,如果有帮助,我正在使用cloud9,Rails-4.1.8和Ruby 2.4.0。

0 个答案:

没有答案