Skip to content

Commit

Permalink
FIX: rubygems 1.5 changes yaml parser from syck to psych, which break…
Browse files Browse the repository at this point in the history
…s mongoid. This injects code into mongoid.rb to force it to use syck to parse yaml
  • Loading branch information
brendte committed Mar 15, 2011
1 parent ef6dac2 commit 8297be7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/template_framework/recipes/mongoid.rb
Expand Up @@ -4,6 +4,10 @@
gem 'bson_ext', '~> 1.2'

gsub_file 'config/application.rb', 'require "active_record/railtie"', '# require "active_record/railtie"'
inject_into_file 'config/environment.rb', :after => "require File.expand_path('../application', __FILE__)\n" do
"require 'yaml'\n"
"YAML::ENGINE.yamler= 'syck'\n"
end

templater.post_bundler do
generate 'mongoid:config'
Expand Down

2 comments on commit 8297be7

@fortuity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer necessary? Rubygems 1.5.3 fixed the yaml parser problem.

@brendte
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, still needed, I think. Not actually a rubygems issue as far as I can tell. It happens for me on 1.9.2p136 with rubygems 1.6.2 and Rails 3.0.5.

Please sign in to comment.