ruby - 是否可以从本地缓存中 bundle/安装 gem?

标签 ruby caching gem bundle

我的电脑上有一堆我想在厨师食谱中使用的 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/

相关文章:

Javascript - 在文本字段中添加数量时应用价格变化

Ruby - 使用 NokoGiri 迭代名称相同但含义不同的 xml 元素

caching - session ID 和浏览器缓存 => 浏览器是否足够智能,可以删除 SessID?

html - 缓存 list 在使用跨域引用和 SSL 的 safari 中不起作用

caching - Heroku 上的 Rails 3.1 Assets 缓存

gem - 为什么使用 .freeze 和 .dup SomeGem::VERSION?

ruby - 在 Rails 3 应用程序中使用 CodeRay 和 Markdown (RDiscount) 突出显示语法

ruby - 如何在 Ruby 中使用 net/imap 搜索邮箱中的邮件?

ruby-on-rails - 在同一 gem 集中的不同版本的 rails 之间切换

Ruby Gem Twitter - 证书验证失败(Twitter::Error::ClientError)