部署heroku时堆栈级别太深(SystemStackError)

问题描述 投票:0回答:1

使用Ruby 2.3.1和Rails 4.2.6时,我的堆栈级别太深了。我该如何解决这个问题?

当我在命令下运行时,出现错误。

heroku run rails db:migrate

这是错误。

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
Traceback (most recent call last):
    8390: from /app/bin/bundle:3:in `<main>'
    8389: from /app/bin/bundle:3:in `load'
    8388: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
    8387: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
    8386: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:123:in `rescue in with_friendly_errors'
    8385: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:45:in `log_error'
    8384: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:95:in `request_issue_report_for'
    8383: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/env.rb:18:in `report'
     ... 8378 levels...
       4: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       3: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       2: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
       1: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>': stack level too deep (SystemStackError)

这是Gemfile.rb

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.8'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.13', '< 0.5', group: :development
gem 'pg', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc



# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

  gem 'pry-rails'
  gem 'compass-rails','~> 2.0'
  gem 'sprockets', '2.11.0'
  gem 'devise'
  gem 'omniauth'
  gem 'omniauth-facebook'
  gem 'omniauth-twitter'
  gem 'bootstrap-sass'
  gem 'dotenv-rails'
  gem 'paperclip'
  gem 'omniauth-instagram'
  gem 'instagram'
  gem 'friendly_id'
  gem 'font-awesome-rails'
  gem 'zeroclipboard-rails'
  gem 'rails-i18n'
  gem 'google-analytics-rails'
  gem 'carrierwave'
  gem 'acts_as_paranoid', '~> 0.6.0'
  gem 'rails_12factor', group: :production

我从4.2.6将rails版本更新到4.2.8。但仍有同样的问题。

甚至,heroku运行bundle exec rake db:migrate不起作用。

无法理解为什么还有这个错误。有人帮帮我吗?

ruby-on-rails ruby heroku ruby-on-rails-4.2 ruby-2.3.1
1个回答
0
投票

我删除了这个错误。生产中的ruby版本是2.5.0,这是不合适的。我的版本下降了2.4.5。从2.5.0,然后它的工作原理。

© www.soinside.com 2019 - 2024. All rights reserved.