仅安装 gem 的一部分

Install only part of a gem

我目前安装了一个很大的 gem,我只使用其中的一部分。那么,几个问题:

只能完整安装 gem,即 gem 规范中声明的所有内容。

If so, does that make more sense then installing the whole thing and only requireing the part I need?

只需要你需要的就是你要找的。如果 gem 在您的 Gemfile 中声明如下:

gem "your_gem", require: false

然后,它不会自动在您的应用程序中被要求,因此不会加载到内存中,这似乎是您想要的效果。然后,只需要你需要的部分。