Rails3 not reloading code in lib while in development mode

后端 未结 4 1008
暖寄归人
暖寄归人 2020-12-13 07:35

THE SITUATION:

  1. I have code in lib/foo/bar.rb with a simple method defined as such:

    module Foo
      class Bar
                 
    
    
            
4条回答
  •  暖寄归人
    2020-12-13 08:25

    Previous answers does not work. Here is a working one: http://ileitch.github.com/2012/03/24/rails-32-code-reloading-from-lib.html

    You have to use both:

    config.watchable_dirs['lib'] = [:rb]
    

    and

    require_dependency
    

    but any config.autoload_paths based solution won't work in Rails ~> 3.2

提交回复
热议问题