gpt4 book ai didi

ruby-on-rails-3 - Gemfile.lock 在 Rails 中使用?

转载 作者:行者123 更新时间:2023-12-03 10:58:48 24 4
gpt4 key购买 nike

Rails 中“Gemfile.lock”的目的是什么?
我一直在四处寻找,但找不到满意的答案。

最佳答案

您应该阅读 bundler 中的所有文档。 gem :http://gembundler.com/

THE GEMFILE.LOCK

When you run bundle install, Bundler will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called Gemfile.lock.

Bundler uses this file in all subsequent calls to bundle install, which guarantees that you always use the same exact code, even as your application moves across machines.

Because of the way dependency resolution works, even a seemingly small change (for instance, an update to a point-release of a dependency of a gem in your Gemfile(5)) can result in radically different gems being needed to satisfy all dependencies.

As a result, you SHOULD check your Gemfile.lock into version control. If you do not, every machine that checks out your repository (including your production server) will resolve all dependencies again, which will result in different versions of third-party code being used if any of the gems in the Gemfile(5) or any of their dependencies have been updated.

关于ruby-on-rails-3 - Gemfile.lock 在 Rails 中使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9208240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com