Really? What is it going to take to get beyond the stupid provocative titles?<p>Can we work on being constructive? It would be pretty sweet if people started writing post-mortems for crazy bugs they found the way people write them for outages.<p>What was the process you went through to track down this problem? Were there any interesting tools or processes you employed?<p>What was the final solution?<p>What can we (both you and your team and the community as a whole) do in the future to prevent this sort of thing from happening again?
Digging around, I found that the author used the JSON gem, relying on to_json taking an optional generator arg. But, yajl-ruby and ActiveSupport define to_json themselves without that, leading to breakage. Those, and the fix for his project[1], are all on GitHub.<p>The author claims most Ruby programmers are monkey-patching and causing these problems. That's almost right: they <i>were</i>. But by and large, they know better now, and would happily replace it with better code, if they could just find it and fix it: that's the real problem.<p>The author could help by, say, logging an issue, or forking and pull requesting a fix. I checked GitHub; his ID, bcoe, doesn't show in the issues, nor in the pull requests of yajl-ruby's GitHub page[2].<p>I'm not saying he <i>must</i> do this for every problem with every open-source project he happens across, but even one contribution helps more than this steam-venting blog post.<p>[1] <a href="https://github.com/bcoe/tire/commit/2dd5fc03" rel="nofollow">https://github.com/bcoe/tire/commit/2dd5fc03</a><p>[2] <a href="https://github.com/brianmario/yajl-ruby" rel="nofollow">https://github.com/brianmario/yajl-ruby</a>
Summary: OP used a gem that depended on other gems, didn't write tests for it and deployed it. This caused problems and he had to go down a rabbit hole which led to a lot of frustration.<p>Snarky response: Duh. Test before you deploy.
A better solution for monkey patching is in the works: <a href="http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-practice/" rel="nofollow">http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-pra...</a><p>That being said, any language feature can be abused and misused
It doesn't have to be ruby to make it hard to integrate your own frankenstack. Can be just as tricky on Java with different types of dependency injection framework and configuration xmls.