Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError for Time value #864

Open
tobmatth opened this issue Mar 6, 2023 · 2 comments
Open

RangeError for Time value #864

tobmatth opened this issue Mar 6, 2023 · 2 comments

Comments

@tobmatth
Copy link

tobmatth commented Mar 6, 2023

I am seeing a RangeError when converting future Time values on Windows. This might be related to #485

irb(main):001:0> date = Time.zone.parse("2040-01-01 00:00:00 UTC")
=> Sun, 01 Jan 2040 00:00:00.000000000 UTC +00:00
irb(main):004:0> { date: date }.to_json
=> "{\"date\":\"2040-01-01T00:00:00.000Z\"}"
irb(main):005:0> Oj.optimize_rails
=> nil
irb(main):006:0> { date: date }.to_json
C:/ruby/versions/3.1.2-x64/lib/ruby/gems/3.1.0/gems/activesupport-6.1.5.1/lib/active_support/json/encoding.rb:22:in `encode': bignum too big to convert into `long' (RangeError)

Oj 3.14.2 works on Linux (Ruby 3.1.2)
Oj 3.14.2 fails on Windows (Ruby 3.1.2)

@ohler55
Copy link
Owner

ohler55 commented Mar 9, 2023

I might need some help testing any potential fix. Are you able to test out a different Oj branch?

@tobmatth
Copy link
Author

Sure 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants