Does Rails load all installed gems?

狂风中的少年 提交于 2019-12-18 07:24:20

问题


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?


回答1:


No, just those that you require or are required by Rails.




回答2:


Rails loads all installed plugins in the application but never the gems unless its explicitly mentioned (using require) in the application



来源:https://stackoverflow.com/questions/1329006/does-rails-load-all-installed-gems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!