How to Fix Frozen String Literal Error

Since version 2.3 Ruby has ability to freeze string literals. Mike Perham has good explanation about how string in Ruby works. Based on his benchmark frozen_string_literal reduces the generated garbage by ~100MB or ~20%.