You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wouldn't normally report an issue with a pre-release version of Ruby, but the JSON gem problem affects every version of Ruby since 1.9.x, it just manifests in weirder, more subtle ways. I've been hacking around it since the 2.0 time period. My production stack is 2.3 stable (vs. an unreleased 2.4), and the 'json' dependency works there, but still creates some quirky situations.
The version of 'json' that has shipped with Ruby since 1.9 is a vendored copy of flori/json, and has since diverged enough with compatibility changes that it looks like a fork. The gem on Rubygems is the (still-maintained) work in flori/json.
The end result of an explicit dependency on "json" is:
Assuming Ruby 1.9+, "require 'json'" can mean odd, subtly different things, esp. when the author expected the behavior (or Object even!) from a stock Ruby install.
Because the builtin 'json' is compiled with Ruby, systems that otherwise wouldn't need build tools (C compiler, ruby-dev, etc) to use the linode gem now do.
There will be times, like now, where JSON functionality would've worked out of the box, but is broken with a slightly lagging 'json' gem. MRI's JSON stays in lock-step with MRI.
So many gems declare a dependency on json, oj, multi_json, or yajl-ruby. There’s so many ossified layers of cruft around JSON processing that only one course of action makes sense: remove it all. JSON has been in the stdlib since 1.9, you don’t need to declare any dependencies at all. Just require 'json' and let Ruby deal with it.
Rails did it, so can you!
The good thing is: linode appears to work just fine with the dependency removed, and all tests pass. This would've been a one-line PR instead of a novel, but the issues are subtle (more so than "let's break out-of-the-box behavior with 1.8.7!") and I wanted to get some feedback about it.
Thanks
The text was updated successfully, but these errors were encountered:
Hey Linode team, et. al.,
I wouldn't normally report an issue with a pre-release version of Ruby, but the JSON gem problem affects every version of Ruby since 1.9.x, it just manifests in weirder, more subtle ways. I've been hacking around it since the 2.0 time period. My production stack is 2.3 stable (vs. an unreleased 2.4), and the 'json' dependency works there, but still creates some quirky situations.
The version of 'json' that has shipped with Ruby since 1.9 is a vendored copy of flori/json, and has since diverged enough with compatibility changes that it looks like a fork. The gem on Rubygems is the (still-maintained) work in flori/json.
The end result of an explicit dependency on "json" is:
I don't know what the linode gem's Ruby version policy is, which could be the constraining factor (1.8 still?), but I believe @mperham summed up the solution that has the best chance of working at the most places:
The good thing is:
linode
appears to work just fine with the dependency removed, and all tests pass. This would've been a one-line PR instead of a novel, but the issues are subtle (more so than "let's break out-of-the-box behavior with 1.8.7!") and I wanted to get some feedback about it.Thanks
The text was updated successfully, but these errors were encountered: