Rails 4 uninitialized constant for module

前端 未结 4 1973
不思量自难忘°
不思量自难忘° 2020-12-13 13:33

In a new rails 4 app I anm getting an unintialized constant error for a module. The module is named ProcessBill and is located in lib/process_bill.rb

console error:<

4条回答
  •  旧巷少年郎
    2020-12-13 13:47

    Have you added lib to your autoload path? This was necessary in Rails 3, I'm not sure if it's still required for Rails 4.

    Try adding this into the class definition in config/application.rb -

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

提交回复
热议问题