Jeremy Walker

Software Developer & Social Entrepreneur

Changing YAML parser to Syck in Ruby on Rails

Meducation use Delayed Job extensively. It's one of the core pieces of our infrastructure.

Sometimes, however, it crashes with an error like:

(<unknown>) couldn't parse YAML at line 17 column 14

The problem is with YAML not deserializing properly, and not raising an exception that DelayedJob is set to handle. Having played around with a few possible solutions, I settled on the one kav1nsky proposes in this StackOverflow answer, which involves changing the YAML parser to Syck.


require 'yaml'
YAML::ENGINE.yamler = 'syck'
just below the line:
require 'rubygems'

Everything now works great again :)

Share This Post


No-one has posted a comment yet. Be the first!

Post a Comment

I'd love to hear your thoughts :)