冻结 Rails 版本/宝石有什么意义? [英] What's the point of freezing your Rails version/gems?

查看:14
本文介绍了冻结 Rails 版本/宝石有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么意思?

在一个项目的说明中,它说冻结 Rails gems".这与冻结 Rails 版本有什么不同?

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

冻死是怎么回事?

推荐答案

如果您使用的 gem 的作者之一介绍了新版本的 gem,则新版本可能会引入向后不兼容的更改,这会破坏您的代码.

If one of the authors of a gem you use introduce a new version of the gem, there is a possibility the new version introduces backwards incompatible changes that would break your code.

冻结 gem 会将其放入应用程序的 vendor 文件夹中,它不会自行自动更新.Rails 将使用此版本的 gem.

Freezing a gem puts it into the vendor folder of your application, and it will not be automatically updated on its own. Rails will use this version of the gem instead.

这允许您为其他应用程序更新系统上的 gem,同时让您的唯一应用程序使用您一直使用的 gem 版本,因此是稳定的.

This allows you to update the gem on your system for other apps, while having your sole app use the version of the gem that you have always been working with, and therefore is stable.

这也适用于 rails gem 本身,因为较新版本的 rails 最终可能会导致您的应用程序中的某些内容中断,冻结它会阻止系统范围的更新(并且再次允许您更新您的其他应用程序)机器,而离开应用程序时,您将轨道冻结在该版本号.

This applies to the rails gem itself as well, as newer versions of rails might eventually cause something in your app to break, freezing it will prevent the system wide update (and, once again, allows you to update other apps on your machine, while leaving the app you freeze rails in at that version number.

这篇关于冻结 Rails 版本/宝石有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆