Actually the replace was what was blowing up. The constant was still resolving to nil, and I was getting a NoMethodError. When I initialized it to an empty string, it worked, strangely.