Understanding the Gemfile.lock file

后端 未结 7 692
南笙
南笙 2020-12-22 17:00

After running the bundle install command, \'Gemfile.lock\' is created in the working directory. What do the directives inside that file mean?

F

7条回答
  •  孤城傲影
    2020-12-22 17:32

    You can find more about it in the bundler website (emphasis added below for your convenience):

    After developing your application for a while, check in the application together with the Gemfile and Gemfile.lock snapshot. Now, your repository has a record of the exact versions of all of the gems that you used the last time you know for sure that the application worked...

    This is important: the Gemfile.lock makes your application a single package of both your own code and the third-party code it ran the last time you know for sure that everything worked. Specifying exact versions of the third-party code you depend on in your Gemfile would not provide the same guarantee, because gems usually declare a range of versions for their dependencies.

提交回复
热议问题