TypeError: ActiveSupport::Duration can't be coerced into Fixnum

I Just upgraded old rails app (3.2.22) to rails 4.2.10 and I am not sure if this is the right place but after a few hours of research, I am a little stumped. BRAND NEW rails 4.2.10 (same ruby) projects work (the behavior below does not happen) but this upgraded project fails on any instance of the ActiveSupport:: Duration functions. Did I miss something in the upgrade? Is it a gem issue? load order?

its not just Fixnum its any of these ActiveSupport::Duration functions

Expected behavior

irb(main):001:0> 20.days
=> 20 days
irb(main):002:0> 20.days.from_now
=> Wed, 13 Jun 2018 22:35:42 UTC +00:00

Actual behavior

	irb(main):003:0> 20.days
TypeError: ActiveSupport::Duration can't be coerced into Fixnum
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/core_ext/numeric/time.rb:35:in `*'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/core_ext/numeric/time.rb:35:in `days'
from (irb):3
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/console.rb:110:in `start'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/console.rb:9:in `start'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
irb(main):004:0> 20.days.from_now
TypeError: ActiveSupport::Duration can't be coerced into Fixnum
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/core_ext/numeric/time.rb:35:in `*'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/core_ext/numeric/time.rb:35:in `days'
from (irb):4
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/console.rb:110:in `start'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/console.rb:9:in `start'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/ttsentsiper/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

System configuration

Rails version: 4.2.10

Ruby version: ruby 2.3.1p112

I also tried upgrading to ruby 2.4 on the same project and the issue persists (seems not ruby related)
Also copied the gemfile from the project that does not work into a new project and things seem ok

I just updated Ruby in my application from 2.1.2 to 2.4.4 and am now receiving the same errors. Using Rails 3.2.22.5 and have not changed that. Maybe that could help you figure it out. Also looking into it right now so please let me know if you do!

Hey, I just fixed this issue when upgrading from ruby 2.1.2 to 2.4.4 on Rails 3.2.22. the solution you are looking for can be found here:

https://stackoverflow.com/questions/41703128/error-while-trying-to-load-the-gem-devise-activesupport-duration-cant-be-coe

you might run into a new error from the solution, and the solution to that can be found here:

https://stackoverflow.com/questions/44053672/simple-rails-app-error-cannot-visit-integer

Hope that helps!