Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix for Ruby 1.9.3-rc1 #116

wants to merge 1 commit into from

The executable was dying on me in Ruby 1.9.3-rc1, looks like an older method in the YAML module was being used. This was causing a undefined method 'each_document' for Psych:Module (NoMethodError)

I didn't find any tests for the executable, but running this at a bash prompt in the root of the project should verify it still works with multiple documents.

cat <<data | ./bin/mustache - ./examples/simple.mustache                                                                         
name: Awesome
value: 200
in_ca: true
taxed_value: 20
name: Awesome2
value: 400
in_ca: false



I can confirm the issue. Can the patch be applied please? Thank you.


BTW it was reported as an Fedora issue:



Pat's patch is a good start, however it breaks default ruby on many platforms commonly used in production.

I've forked the gem and adapted the patch for compatibility. See also #143.


gem 'mustache', :git => ""


gem install mustache --source


The Gem available on appears to be the unpatched version. It has the same problem, and I examined the source code. It is the original code with just the call to YAML.each_document


same problem under ruby 2.0.


+1 ( ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] )

@locks locks referenced this pull request

1.9.3+ YAML compatibility #143


Fixed by #143.

@locks locks closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2011
  1. @patmcnally
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  bin/mustache
2  bin/mustache
@@ -73,7 +73,7 @@ class Mustache
yaml = $2.strip
template = doc.sub($1, '')
- YAML.each_document(yaml) do |data|
+ YAML.load_stream(yaml).each do |data|
puts Mustache.render(template, data)
Something went wrong with that request. Please try again.