[Ironruby-core] Problem with using OpenStruct and ERB

Nathan Standiford nstandif at live.com
Tue Jun 19 16:51:36 UTC 2012


I am using OpenStructs and ERB for template generation. In this simple
example, ruby 1.8.6 runs this fine:

require "erb"

require "ostruct"

puts ERB.new("<%=foo%>", 0, "%<>").result(OpenStruct.new({ :foo => "bar"
}).send(:binding))

 

However, it generates the following error when I run this in IronRuby
1.1.3.0 on .NET 4.0.30319.269:

(erb):2: undefined method `foo' for main:Object (NoMethodError)

 

Does anyone know how to get this to behave correctly in IronRuby?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20120619/ea28bbb2/attachment.html>


More information about the Ironruby-core mailing list