When working with rails, it’s quite useful to change a source file, save it, and reload a web application merely by refreshing the web browser. This had been working great, until one day when my changes didn’t appear in the browser.
I tried clearing the cache on the browser, but it didn’t help. Only when I restarted rails would the change get picked up. Considering that this took a good bit longer than simply refreshing the browser, this caused a serious drain on my productivity and warranted an investigation.
After some initial searching, I discovered the
config.cache_classes setting. Here is how the documentation describes it:
config.cache_classescontrols whether or not application classes and modules should be reloaded on each request. Defaults to false in development mode, and true in test and production modes. Can also be enabled with
That sounded promising - all I had to do was disable caching. I went back to
development.rb, and here is what I saw:
config.cache_classes = false