简体   繁体   中英

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3

I'm upgrading a rails 3.0.9 app to 3.2.13 and from ruby 1.8.7 to 1.9.3. Any time I try to access a controller action, I get the following error

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)

The only way I've been able to get a page to load without error is to clear out the database sessions (rake db:sessions:clear) and then restart the rails server. This allows ONE single request to succeed and then all subsequent requests fail.

I've tried comparing all my core config files to a working 3.2 app and have also tried to upgrade all of my gems.

Here's my current 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

This ended up being caused by this rails issue: https://github.com/rails/rails/issues/3144

Changing this in the model from:

include Rails.application.routes.url_helpers

To:

Rails.application.routes.url_helpers.path_that_i_was_referencing_in_a_model

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM