1

What I'm trying to determine is what can be changed on-the-fly in a Rails application w/o restarting the web server.

My assumption is that anything that requires bundler needs restarting and any regular ascii based files (html/css/js) or images can be modified on the fly, but how about:

  • /app/controllers/
  • /app/models/
  • /app/views/
  • /config/database.yml

Do any changes to the ruby (*.erb, *.rb) files require a recompile and the web server to be restarted?

BotNet
  • 2,759
  • 2
  • 16
  • 17
  • Anything involving structural changes to the database, such as a migration, requires a restart. – franksort Feb 17 '14 at 02:33
  • controllers, models and views are all reloaded each request in development; changes to `config/database.yml` require a restart. – user229044 Feb 17 '14 at 02:44

1 Answers1

1

There is no strict answer to that question.

In general, Rails tries to reload everything it can without sacrificing development speed.

That is basically everything in app and what you define in config.autoload_paths.

You can circumvent some restrictions yourself, have a look about how to enable middleware code reloading: Reloading rails middleware without restarting the server in development

Community
  • 1
  • 1
phoet
  • 18,688
  • 4
  • 46
  • 74
  • but can you just make changes to a script file w/o having to run any other command? From a PHP and Perl perspective it seems the workflow is more sequential and easier to see how things are generated, but with Rails my understanding is more limited, making the loading/code-sourcing seem more magical. – BotNet Feb 17 '14 at 04:07
  • i don't understand your question. concerning "magic" rails promises to reload files in app and config.autoload_paths. that's all. everything else you need to take care of yourself. – phoet Feb 17 '14 at 04:24