Rails是否会加载所有已安装的宝石? [英] Does Rails load all installed gems?
问题描述
所有这些gem都被加载了,并且会导致应用程序运行速度更慢或占用更多内存(注意我的服务器上运行了两个应用程序实例,一个在线,另一个在测试环境中)?如果Rails正在加载所有已安装的宝石,是否有办法让它只加载冻结的宝石,而没有其他的方法?
否,只是那些您需要或Rails需要的。
When Rails loads, does it load all the gems that are installed on the system? I've got 47 gems installed on the server, including all the various Rails gems which have multiple versions. However, both Rails, and all the gems used by the application, are frozen into the application.
Are all those gems getting loaded, and would that cause the application to run slower or take up more memory (note I've got two instances of my application running on the server, one live and one as a test environment)? If Rails is loading all the installed gems, is there a way to make it just load frozen gems and no others?
No, just those that you require or are required by Rails.
这篇关于Rails是否会加载所有已安装的宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!