【问题标题】:How to install Ruby Gems, also caching them along the way?如何安装 Ruby Gems,同时缓存它们?
【发布时间】:2014-12-08 03:34:10
【问题描述】:

当通过 pip 使用 Python 时,我们可以指定一个环境变量,该变量表示还将包下载到缓存位置:“How do I install from a local cache with pip?”。

export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache
pip install numpy

我们怎样才能为 bundler 做同样的事情?

【问题讨论】:

    标签: python ruby caching installation bundler


    【解决方案1】:

    gem 命令行工具自动缓存 gem。来自the documentation

    Gem::Installer 负责将文件放在文件系统上的所有正确位置,包括将 gem 解压到 gem 目录中,将 gemspec 安装到规范目录中,将缓存的 gem 存储在缓存目录中,并为可执行文件安装包装器或符号链接。

    【讨论】:

    • gem pristine 利用缓存来重建 gems。如果你在系统中升级一些破坏 Ruby 的东西是非常方便的。
    猜你喜欢
    • 1970-01-01
    • 2011-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多