I'm testing out a basic Rails app and I seem to be getting some undesirable caching behavior on a library script that's being require()'ed into my controller script.
Suppose FooController.rb
contains the following:
require 'utils' # a library script
class FooController
def some_action
@some_member = do_something() # global method defined in utils.rb
end
end
It appears that changes to utils.rb
do not take effect until I restart the Rails server. I don't believe this is due to a misconfiguration of Rails' class caching, since a) I am running in a "development" environment, and b) I can make changes directly to the controller code (e.g., to the some_action
method above) that are reflected upon the next execution of the script. I've been testing this with some calls to puts
that spam messages into the console.
Is there some behavior in either Ruby or Rails that would cause require()-ed scripts to remain cached? If so, is there a way to configure that behavior?