Created
May 15, 2014 08:41
-
-
Save djo/c8a6ca3ff5661d226276 to your computer and use it in GitHub Desktop.
Setup Syck YAML engine in Ruby 2, Rails, DelayedJob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
# Set up gems listed in the Gemfile. | |
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | |
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) | |
# YAML Syck engine support was dropped in Ruby 2.0 and it's available only by a gem 'syck'. | |
# Some gems (delayed_job[1] for instance) have YAML extensions depending on the engine. | |
# Switching to the Syck engine should be done in boot.rb before loading all gems in application.rb: | |
require 'yaml' | |
require 'syck' | |
YAML::ENGINE.yamler = 'syck' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment