简体   繁体   English

为什么 bundler 不使用系统 gems?

[英]Why bundler doesn't use system gems?

Bundler version: 1.15.1 .捆绑版本: 1.15.1 Ruby version: 2.3.1 .红宝石版本: 2.3.1 I have (from gem env ):我有(来自gem env ):

  - GEM PATHS:
     - /var/lib/gems/2.3.0
     - /root/.gem/ruby/2.3.0
     - /usr/lib/x86_64-linux-gnu/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/all

With all the gems from Gemfile.lock present under /var/lib/gems/2.3.0 .来自 Gemfile.lock 的所有宝石都存在于/var/lib/gems/2.3.0下。 But bundler will not try to re-use these and instead will attempt to redownload every time.但是 bundler 不会尝试重新使用这些,而是​​每次都会尝试重新下载。

My .bundle/config :我的.bundle/config

    ---
    BUNDLE_PATH: "vendor/bundle"
    BUNDLE_BIN: "vendor/bin"
    BUNDLE_DISABLE_SHARED_GEMS: "true" <--- removing this config entry doesn't help

running bundle install just re-downloads the gems instead of saying 'Using' so takes a long time.运行bundle install只是重新下载 gems 而不是说“使用”,所以需要很长时间。

What are the settings that might cause this and how to make the bundler get gems from system path /var/lib/gems/2.3.0 ?哪些设置可能会导致这种情况以及如何让捆绑程序从系统路径/var/lib/gems/2.3.0获取 gems?

I have read the bundle and bundle install docs fully but can't see how I can make bundler use the system gems.我已经完全阅读了 bundle 和 bundle install 文档,但看不到如何让 bundler 使用系统 gem。 Other than using source 'file:///var/lib/gems/2.3.0' after generating an index, but I would really like to avoid this and use a more elegant solution.除了在生成索引后使用source 'file:///var/lib/gems/2.3.0' ,但我真的很想避免这种情况并使用更优雅的解决方案。 Especially since it would probably cause the gems to be re-installed which takes even more time than re-download.特别是因为它可能会导致 gem 被重新安装,这比重新下载需要更多的时间。

You have set BUNDLE_DISABLE_SHARED_GEMS to true .您已将BUNDLE_DISABLE_SHARED_GEMS设置为true This setting instructs bundler to specifically ignore any system-installed gems.此设置指示 bundler 专门忽略任何系统安装的 gem。 Instead, bundler downloads all required gems into your BUNDLE_PATH .相反,bundler 将所有必需的 gem 下载到您的BUNDLE_PATH

If you want to use system-installed gems if appropriate, remove the BUNDLE_DISABLE_SHARED_GEMS setting from your bundle config.如果您想在适当的情况下使用系统安装的 gem,请从您的捆绑配置中删除BUNDLE_DISABLE_SHARED_GEMS设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM