New to RoR. I understand the principle of Rack, but nowhere can I find any coherent information on working in production and development environments.

    1 answer 1

    Environments - not the Rack level - it will work in all environments equally, exploitation is just a convenient means of organizing the project, its configuration files and gems for the development environment and server-side production.

    When developing, you may need various debug gems to facilitate the development and setup of hosts and accounts for local databases. In a production environment, on a server, you do not need half of gems, or vice versa, you may need monitoring gems or gems for a production server that are useless in a development-environment.

    Superfluous gems will just in vain take up space on the disk and in memory. In addition, locally and to the server, you need other settings for databases. Often, environments are used to define different Web servers in operational and development environments. For example, you can use the Webrick server or thin server locally, and in the production environment of the Unicorn or Puma server.

    In addition to production and development, you can enter your own environments. For example, a staging environment is often used for a demonstration test server, where you first check the performance, demonstrate the best practices to the customer before rolling them out to the production server. Often resort to a test-environment in which tests are driven. The latter is due to the fact that in order to isolate tests, they often delete the contents of the database before each new test — it is important that such deletion does not concern your development-database, or even God forbid a production-database.

    Those. environments are just a convenient way to organize work on a project, different modes of operation of your application. Rack will work equally in all environments.

    • Thank you very much for your answer! - john_doe