I have been struggling with this for some time, too. None of the solutions work, including the autoload_paths
and autoload_once_paths
tricks. Furthermore, the hack with FileUpdateChecker
and initializers also does not help (the checker triggers properly, but the files are not reloaded). Same for config.reload_plugins = true
...
However, there is a solution. In app/controllers/application_controller.rb
add one line:
require_dependency 'your_file_name_here'
The application controller is reloaded on every request and require_dependency
makes your file to be checked for modifications and reloaded accordingly. It worked for me, Apache 2, Passenger 3 and Rails 3.0.3.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…