RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12214

In Rails 3.1, libraries in "lib" directory are no longer "require"d

I have recently upgraded my app from Rails 3.0.9. to Rails 3.1.3. I have a library that I maintain in the "appname/lib" directory. What I have found are errors in any model code that references this module.

There's no way I should have to do an explicit "require" of a central library. It sounds like I may have missed something during the upgrade to 3.1 regarding the load paths, but I don't know what. Any help is appreciated.

Upvotes: 0

Views: 312

Answers (1)

Robin
Robin

Reputation: 21884

config.autoload_paths += %W(#{config.root}/lib)

in config/application.rb.

lib is not autoloaded now.

Upvotes: 1

Related Questions