Search code examples
ruby-on-railsruby-on-rails-3webrick

Rails Webrick: Configure what directories are watched for changes


At the moment I'm having to restart the server if I change files in the lib/ and app/helpers/ directories. Is there a way to configure either Rails or Webrick such that it hotswaps the files in those directories as well?


Solution

  • In your config/application.rb:

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

    There should be a commented line which explains what autoload_paths is for.