From: Xavier Noria Date: 2010-02-11T18:12:52+09:00 Subject: Re: Newbee question. Runtime classloading Ruby needs to interpret the file where the class is defined before you can use it. Interpreting the file has the side-effect of defining the constant, which is in turn a side-effect of the class keyword. As you surely know that is typically done with require, and if the parsers are unknown beforehand you can just use Dir[] with a glob to require whatever has some filename pattern in a loop or something. I mean, require is a method you can call it wherever you want. Rails does not need that because it offers class/module autoloading: if the filename is named after the class using some common sense conventions, and lives in some of the standard directories, app/something, lib, etc., then the dependencies mechanism goes and loads it for you the first time the constant is used. That is accomplished basically via a Ruby hook called const_missing that is triggered when that initial failure happens.