What's the point of freezing your Rails version/gems?

后端 未结 4 1774
难免孤独
难免孤独 2020-12-10 05:02

What does that mean?

In the instructions for a project, it said to \"freeze the Rails gems\". Is that different from freezing the Rails version?

What\'s free

4条回答
  •  猫巷女王i
    2020-12-10 05:45

    I think Phillc hit the nail on the head with his comments.

    Whenever you have an application running in a production environment that people count on working, you have to have a mechanism for 'freezing' the environment. Updating rails could cause your application to stop working correctly.

    It could be something minor or something that stops your users from getting their work done.

    Just google 'rails gem update breaks my app' to see some tails of woe.

    Igor Minar has a good blog entry on why you should freeze both gems and Rails as well as discussing how you can now set specific gem version dependencies in Rails.

    You can freeze Rails, you can freeze gems, you can set dependency on specific gem version in your environment.rb file.

    The reason you would do this is to ensure that your app does not break when an updated version of a gem or of Rails is released. Freezing lets you test an update on a separate machine, make sure it passes all of your automated test suites, lets your users put the updated app through its paces, and then (after a good backup) you apply the update to the gem or to Rails.

提交回复
热议问题