我的电脑上有一堆我想在厨师食谱中使用的 gem 。
我知道可以将它们放在像/tmp/gems 这样的目录中,并且只是:
cd /tmp/gems
gem install *.gem
是否可以将所有 gem 放在一个目录中,这样我就可以使用 bundler 安装它们而无需再次下载它们?
cd /somedir/my_rails_project
bundle
我想节省带宽。
最佳答案
bundle install --local
应该是你想要的。来自bundle-install手册页:
--local Do not attempt to connect to rubygems.org, instead using just the gems located in vendor/cache. Note that if a more appropriate platform-specific gem exists on rubygems.org, this will bypass the normal lookup.
关于ruby - 是否可以从本地缓存中 bundle/安装 gem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8567071/