From: Davi Barbosa Date: 2008-10-02T23:19:16+09:00 Subject: eruby: problem defining a new method for Array Hello, I installed eruby yesterday and I spend all night programming... I'm trying to define a new method for class Array but apache2+mod_ruby can't find the method! A create a simple example: error <% class Array def to_hash {'test' => 'ing'} end end print [1,2,3].to_hash %> When I try to open this page, I get this error: simple.rhtml:18: undefined method `to_hash' for [1, 2, 3]:Array (eval):117 /usr/lib/ruby/1.8/apache/eruby-run.rb:116:in `eval_string_wrap' /usr/lib/ruby/1.8/apache/eruby-run.rb:116:in `run' /usr/lib/ruby/1.8/apache/eruby-debug.rb:70:in `run' /usr/lib/ruby/1.8/apache/eruby-debug.rb:56:in `handler' If I try the same code in a sample ruby script, it works. Even if I try directly with eruby it works: $ eruby simple.rhtml [omitted output] testing Anyone have any idea? Also, someone knows where to ask? I searched for a eruby mailing list or forum but I did not find. -- Posted via http://www.ruby-forum.com/.