20
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

Rubyを2.4に上げたら4.2系列のRailsが stack level too deep で死ぬ時の対処法

Ruby2.4 が出たので軽率にアップデートするとこんなエラーが出ました。

/Users/ironsand/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/Users/ironsand/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
/Users/ironsand/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/business_time-0.7.6/lib/business_time/core_ext/fixnum.rb:6: warning: constant ::Fixnum is deprecated
/Users/ironsand/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/numeric/conversions.rb:124:in `block (2 levels) in <class:Numeric>': stack level too deep (SystemStackError)

いくつかの警告とstack level too deepエラーがactive_supportnumericで出てますね。

対策

Railsの4.2系の最新の4.2.7.1でもまだ対応できてないようなので、githubから最新の安定版ブランチをとってきましょう。

Gemfile
gem 'rails', github: 'rails/rails', branch: '4-2-stable'

参考

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
20
Help us understand the problem. What are the problem?