NoMethodError in Lag#index

Showing /home/app/webapp/app/views/lag/index.rss.builder where line #42 raised:

undefined method `gsub' for nil:NilClass
Extracted source (around line #337):
335
336
337
338
339
340
              
# text2 = text2.html_safe
#text2 = text2.html_safe
text2 = text2.gsub(/\[\[kalender:(.*)\]\]/) {
@kalendercss = 1
arg = $1
if arg =~ /navn=\"(.*)\"/

Rails.root: /home/app/webapp

Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"lag"=>"Sentralt",
 "id"=>"121",
 "format"=>"rss"}

Response

Headers:

None