Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a global cache for .gem files, shared by all Bundler and RubyGems installs #7249

Open
indirect opened this issue Dec 11, 2023 · 8 comments

Comments

@indirect
Copy link
Member

As discussed in #6102, it would save hard drive space, network bandwidth, and download time to have a single global cache of .gem files shared across all versions of Ruby, RubyGems, and Bundler.

My proposal for the default location for this cache is ~/.cache/rubygems/gems.

@simi
Copy link
Member

simi commented Dec 19, 2023

My proposal for the default location for this cache is ~/.cache/rubygems/gems.

What about "#{Gem.cache_home}/gem/gems"? That's closer to other directories . Gem.cache_home respects XDG_CACHE_HOME and defaults to "#{Gem.user_home}/.cache" which is usually ~/.cache as suggested and other gem directories are using gem subdirectory in XDG dirs as a "namespace".

@indirect
Copy link
Member Author

#{Gem.cache_home}/gem/gems sounds good to me 👍🏻

@deivid-rodriguez
Copy link
Member

I think bundler already has an opt-in global cache, enabled with the global_gem_cache setting.

@indirect
Copy link
Member Author

Sounds like we might be able to resolve this issue by turning on the global cache by default, then? 😅

@deivid-rodriguez
Copy link
Member

Yes! Although it still wouldn't be shared by RubyGems.

@indirect
Copy link
Member Author

Oh! Right, of course. I will keep this ticket open as a placeholder for a fully global gem cache, then, shared by both RubyGems and Bundler, and enabled by default. 👍🏻

@h3xx
Copy link

h3xx commented Dec 21, 2023

I think bundler already has an opt-in global cache, enabled with the global_gem_cache setting.

@deivid-rodriguez I was unable to find any references to the global_gem_cache setting. Can you please link me to the documentation and/or provide an example of how to set this up?

@deivid-rodriguez
Copy link
Member

See https://bundler.io/v2.4/man/bundle-config.1.html#LIST-OF-AVAILABLE-KEYS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants