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

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

问题描述

这是什么意思?

在一个项目的说明中,它说冻结Rails的宝石。这与冻结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会将它放入应用程序的供应商文件夹中,并且它不会自动更新。相反,Rails将使用此版本的宝石。

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.

这使您可以更新系统上的其他应用程序的宝石,同时让您的唯一应用程序使用宝石的版本你一直在使用,因此是稳定的。

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天全站免登陆