Rails 3 doesn’t autoload files under the lib directory anymore (aka lazy loading). There was quite a discussion about this controversial decision, while lazy loading can be very good and useful, it is also convenient to not have to include every file/folder manually. Fortunately, there is an easy way to enable autoloading again. While most solutions on the Internet only show how to load one directory, here is a solution that autoloads lib including all subdirectories on startup.
Put this in config/application.rb:
Update:
See also our blog post, how you can force Rails 3 to reload the lib files: http://hemju.com/2011/02/11/rails-3-quicktip-auto-reload-lib-folders-in-development-mode/
In Rails 3 hat man den Mechanismus für das Laden der lib Dateien von automatisch auf manuell umgestellt (aka lazy loading). Über diese umstrittene Entscheidung gab es bereits einige Diskussionen mit den Entwickler. Lazy Loading hat oftmals Vorteile und seine Berechtigung, aber andererseits ist es auch mühsam jede Datei und Verzeichnis manuell hinzuzufügen. Glücklicherweise gibt es eine einfache Lösung um das alte Verhalten wiederherzustellen. Die meisten Lösungen im Internet zeigen nur wie man ein Verzeichnis automatisch lädt, hier ist eine die automatisch das lib Verzeichnis inklusive aller Unterverzeichnisse lädt.
Einfach folgendes in die Datei config/application.rb eintragen:

Pingback: Adoption Curve » Blog Archive » links for 2010-10-18