<div style="color:red">undefined method `gsub&#39; for nil:NilClass</div>