01 2 / 2012

Autoloading in Rails 3

Rails 3 by default adds these to the autoload paths:

app/*
vendor/plugins/*/lib
vendor/plugins/*/app/*

In addition, gems, when they are defined as Rails engines/railties, get each directory in app added to the autoload path.

Notable exceptions: Rails does not automatically add its own lib directory or the lib directories of any plugins to the load path.