title: Problem using OpenStruct with ERB
body: <p><strong>EDIT:</strong> forgot to include my environment info... Win7x64, RubyInstaller Ruby v1.9.1-p378</p>
  
  <p><strong>EDIT 2:</strong> just updated to v1.9.1, patch 429, and still getting this same error.</p>
  
  <p><strong>Edit 3:</strong> running this same code in Ruby v1.8.7, patch 249, works fine. so it's v1.9.1 that broke it, apparently.</p>
  
  <p>I'm new to using ERB and the samples i could find are... ummm... less than helpful... having played around with ERB for about an hour, I got some basic examples working (finally), but I have no idea why this doesn't work... </p>
  
  <pre><code>require 'ostruct'
  require 'erb'
  
  data = {:bar => "bar"}
  vars = OpenStruct.new(data)
  
  template = "foo "
  erb = ERB.new(template)
  
  vars_binding = vars.send(:binding)
  puts erb.result(vars_binding)
  </code></pre>
  
  <p>this code produces the following error:</p>
  
  <pre>irb(main):007:0> puts erb.result(vars_binding)
  NameError: undefined local variable or method `bar' for main:Object
          from (erb):1
          from C:/Ruby/v1.9.1/lib/ruby/1.9.1/erb.rb:753:in `eval'
          from C:/Ruby/v1.9.1/lib/ruby/1.9.1/erb.rb:753:in `result'
          from (irb):7
          from C:/Ruby/v1.9.1/bin/irb:12:in `'
  </pre>
  
  <p>why is it looking at the <code>main:Object</code> binding? I told it to use the binding from the OpenStruct by passing in <code>vars_binding</code></p>
  
  <p>can someone fill me in on why it doesn't work, and help me get it to work?</p>