0

I'm using {{site.url | cgi_escape}} in my index.html file in a Jekyll 1.1.2 project. Whenever running a server, the build fails because of Liquid Exception: private method `gsub' called for nil:NilClass

On my other computer I have Jekyll 0.12.0 and the same project does build successfully.

What might be the way to solve this problem?

Julia K Szopa
  • 151
  • 1
  • 6
  • Does http://stackoverflow.com/questions/3031229/what-does-liquid-error-private-method-gsub-called-for-nilnilclass-mean-on help? Is your site.url set? – sziwan Aug 30 '13 at 08:21
  • Yup, site.url is set in _config and {{site.url}} renders properly as expected. The problem occurs only when cgi_escape filter is applied. Since the problem is only on Jekyll 1.1.2 and not on 0.12.0 I guess it has to do with the jekyllversion or maybe Liquid version installed? – Julia K Szopa Aug 31 '13 at 02:33

1 Answers1

1

I solved the same error message when trying to apply the uri_escape filter to a page variable in the post layp

{{page.description | uri_escape}}

Turns out that not all of my posts had the description variable set in the yaml front matter. Adding the description variable to all posts and re-running jekyll build sorted the problem.

John Moxon
  • 31
  • 3
  • I had a very similar problem caused by one of my posts not having an excerpt - it complained about `search.json`, but otherwise the error was the same. This was with Jekyll 3.1.2. – mjturner Apr 06 '16 at 20:53