[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

PRB: Can't add methods to base classes

scharfie

7/16/2005 5:25:00 PM

At a Windows command prompt, the following Ruby script executes just
fine:

class Array
def new_method()
"Hello"
end
end
puts [""].new_method

However, browsing to this script on my localhost (apache2) gives a
NoMethodError:

undefined method `new_method' for [""]:Array

I've tried with both mod_ruby and fastcgi bindings, but I can't get it
to work. Is there a config. setting I'm missing?