So, you have fancy spiffy code. It looks kinda like this:
It works great on your local machine, doing what you need.
Then, you deploy. And the world ends. It ends, not in fire, or water, but a LocalJumpError, like so
“WTF?” you think.
Check your Ruby versions. I bet production is 1.8.6 and your local machine in 1.8.7. Naughty.
1.8.7 will implicitly do a .to_a right before the inject. 1.8.6 does *not*.
Here’s how to make it work in both: