升级到rails 3.2和ruby 1.9.3后,堆栈级别太深错误

时间:2013-07-25 13:18:47

标签: ruby-on-rails ruby-on-rails-3.2

我正在将rails 3.0.9应用升级到3.2.13并从ruby 1.8.7升级到1.9.3。每次我尝试访问控制器操作时,都会出现以下错误

Started GET "/myapp/login" for 127.0.0.1 at 2013-07-25 07:10:06 -0600

SystemStackError (stack level too deep):
  actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:70
  Rendered /actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
  Rendered /actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (5.2ms)
  Rendered /actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (22.6ms)

我能够在没有错误的情况下加载页面的唯一方法是清除数据库会话(rake db:sessions:clear)然后重新启动rails服务器。这允许单个请求成功,然后所有后续请求都失败。

我已经尝试将所有核心配置文件与工作3.2应用程序进行比较,并尝试升级所有宝石。

这是我目前的Gemfile:

source 'http://rubygems.org'

gem 'rails',                      '3.2.13'
gem 'mysql2',                     '~> 0.3'
gem 'dynamic_form',               '1.1.4'
gem 'validates_timeliness',       '~> 3.0'
gem 'authlogic',                  '~> 3.3'
gem 'cancan',                     '~> 1.6'
gem 'jquery-rails',               '~> 1.0.19'
gem 'simple_form',                '~> 2.1'
#gem 'rails3-generators',         '0.17.4'
gem 'yaml_db',                    '0.2.2' #
gem 'will_paginate',              '~> 3.0'
gem 'activemerchant',             '1.26.0', :path => "vendor/gems/activemerchant-1.26.0" #
gem 'active_utils',               '~> 1.0'
gem 'httparty',                   '~> 0.11'
gem 'forgery',                    '~> 0.5'
gem 'mail',                       '~> 2.5'
gem 'state_machine',              '~> 1.2'
gem 'uuid',                       '~> 2.3'
gem 'rails_config',               '~> 0.3'
gem 'machinist',                  '2.0'
gem 'memcache-client',            '1.8.5'
gem 'fastercsv',                  '~> 1.5'
gem 'faker',                      '~> 1.1'
gem 'rack-ssl',                   '~> 1.3', :require => 'rack/ssl'
gem 'sendgrid',                   '~> 1.2'
gem 'prawn',                      '0.12.0'
gem 'friendly_id',                '~> 4.0'
gem 'whenever',                   '~> 0.8', :require => false
gem 'rake',                       '0.9.2.2' #
gem 'exception_notification',     '3.0.1' #
gem 'credit_card_validator',      '~> 1.1'
gem 'deadlock_retry',             '~> 1.2'
gem 'delayed_job_active_record',  '~> 0.4'
gem 'daemons',                    '1.0.10'
gem 'active_attr',                '~> 0.8'

group :assets do
  gem 'sass-rails',               '~> 3.2.3'
  gem 'coffee-rails',             '~> 3.2.1'
  gem 'uglifier',                 '>= 1.0.3'
end

group :development, :test do
  gem 'mocha',                    '~> 0.14', :require => false
  gem 'vcr',                      '~> 2.5'
  gem 'fakeweb',                  '1.3.0'
  gem 'capistrano',               '~> 2.15'
  gem 'ruby-debug-ide',           '0.4.17', :require => false
  gem 'letter_opener',            '~> 1.1'
  #gem 'better_errors'
  gem 'thin'
end

1 个答案:

答案 0 :(得分:2)

最终导致此问题导致:https://github.com/rails/rails/issues/3144

在模型中更改此项:

include Rails.application.routes.url_helpers

要:

Rails.application.routes.url_helpers.path_that_i_was_referencing_in_a_model