end of stream while scanning a quoted scalar

If your Jekyll site isn't building because of a problem in psych.rb, you might have bad YAML somewhere.

By Matthew Malinowski, 2012-12-02

If you're building your Jekyll site and you see something like this:

/Users/$you/.rvm/rubies/ruby-$yourversion/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): found unexpected end of stream while scanning a quoted scalar at line 4 column 23 (Psych::SyntaxError)

(and then many more lines tracing this call back), it almost certainly means you have something bad in your YAML somewhere.

I couldn't find a quick way to discern what the problem was, so I just manually reviewed the files changed since the last stable build. True enough, I had a string wrapped with single quotes that contained an apostrophe. Escaping the apostrophe didn't work, so I wrapped the string in double quotes and escaped the apostrophe, and it worked. :thumbsup:

Back to Blog Index...