Today I Learned

Don't try to modify strings that come out of ENV

Today I woke up to an exception RuntimeError: can't modify frozen String

I looked at the code that had raised the exception. It was doing a gsub! on a value out of params. It took me a bit of digging to figure out why it failed. Turns out there's an edge case that causes one of those values to get pulled out of ENV instead of the normal flow where it originates from the user.

Strings coming out of ENV are frozen. D'oh!

Looking for help? Obie Fernandez of Kickass Consulting has been one of the most sought-after Ruby experts worldwide for over 10 years. Ruby is one of our core languages at Kickass Consulting and we'd love to take a look at your project. Contact us today and find out how we can help you.