From: Tim Pease Date: 2009-01-31T03:28:53+09:00 Subject: binding in ruby1.9 Could someone explain why this code does not work in ruby1.9 and possibly provide a workaround. The end goal is to be able to pass a binding to an ERb result method that provides a limited set of variables to the ERb template evaluation. > cat a.rb obj = Object.new class << obj attr_accessor :foo end obj.foo = 'the foo method' eval "puts foo", obj.__send__(:binding) > ruby a.rb the foo method > ruby1.9 a.rb a.rb:7:in `eval': undefined local variable or method `foo' for main:Object (NameError) from a.rb:7:in `eval' from a.rb:7:in `
' >ruby1.9 --version ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0] Blessings, TwP