php - Ruby web application working modes -


when write web app on php can works in different modes: fcgi (php-fpm), apache module (mod_php) , on. in cases when editing php scripts application updates immediatelly without need restart server. know ruby web app can works in different modes (i.e. fcgi withing unicorn + nginx). want idea common ways launch ruby web app , techincal details means (i.e. when should restart server update scripts), proc , cons.

there many ways write ruby applications, classic 1990s-style cgi, fastcgi, independent http-capable processes mongrel or thin , more modern, recommended approach uses launcher passenger manage processes more directly.

ruby on rails can have several operating modes. default 2 development , production. these have important differences:

in development:

  • anything in app/ or config/routes.rb reloaded each request.
  • the log/development.log verbose possible, recording each query executed.
  • assets served in raw form, can changed time.

in production:

  • application loaded once , cached, changes require restart.
  • the log/production.log file contains errors , important notifications.
  • assets minified, compressed, , served in bundles. minor changes require repackaging everything.

it's bad idea editing scripts on production server, rails approach thing. if need rapidly iterate on something, on local copy , push changes server when you're confident they'll work.

if need emergency fix on server, can edit code, touch tmp/restart.txt force reload. when change assets you'll have run rake assets:precompile repackage them.

like lot of things, rails makes recommended approach easy , risky 1 hard.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -