Giter Club home page Giter Club logo

Comments (14)

Bo98 avatar Bo98 commented on September 25, 2024 1

Setting it unconditionally to HOMEBREW_CACHE/bundler could make sense.

after clearing Homebrew gems

How are you clearing the gems?

from brew.

Bo98 avatar Bo98 commented on September 25, 2024 1

Yeah that's the supported way. Will check why Bundler doesn't cleanup plugins.

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on September 25, 2024

Why do you want this variable to be honoured?

That Homebrew uses Bundler should be seen as an implementation detail. This seems like a potentially small performance improvement for developer commands in exchange for a higher change of errors occurring with cache/Bundler issues.

from brew.

dkav avatar dkav commented on September 25, 2024

I am not sure we are on the same page. Hopefully the following will add more clarity.

On macOS I have setup my shell environment to follow the XDG directory spec as much as possible. To have my preferences supported by Bundler I added the BUNDLER_USER_* variables to my profile per Bundler's instructions. Using Bundler (installed via Homebrew's Ruby formula) directly I found that my defined paths were honored and the default ~/.bundler folder was not created. However, outside my use of Bundler I found that the ~/.bundler folder was being created and used by another tool. After a little testing, I found that Homebrew's use of Bundler was the source and only the ~/.bundler/cache folder was being created.

So for me, supporting BUNDLER_USER_CACHE would reduce some confusion and potentially support a user's existing preferences.

(I did try one quick attempt at implementing a solution but I was unsuccessful.)

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on September 25, 2024

After a little testing, I found that Homebrew's use of Bundler was the source and only the ~/.bundler/cache folder was being created.

Was anything put in it/used from it? Ideally we'd avoid creating/using these sorts of directories in Homebrew at all. I agree with avoiding writing things to $HOME is ideal if possible.

from brew.

dkav avatar dkav commented on September 25, 2024

Yes. Standard looking compact_index folder and contents.

Attached is directory listing after running the following:

brew install-bundler-gems --groups=
rm -frd ~/.bundle
brew install-bundler-gems --add-groups=bottle
ls -R ~/.bundle > ~/Downloads/ruby-cache-ls.txt

ruby-cache-ls.txt

from brew.

dkav avatar dkav commented on September 25, 2024

As a side note, after clearing Homebrew gems and then reinstalling the following error is consistently flagged.

Error loading RubyGems plugin "/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/plugins/yard_plugin.rb": cannot load such file -- /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/yard-0.9.36/lib/rubygems_plugin.rb (LoadError)

from brew.

dkav avatar dkav commented on September 25, 2024

How are you clearing the gems?

Via brew install-bundler-gems --groups=

I found the solution in a comment on GitHub. It wasn't clear to me how to do it otherwise.

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on September 25, 2024

Setting it unconditionally to HOMEBREW_CACHE/bundler could make sense.

Agreed. Should just be an environment variable to do so.

from brew.

dkav avatar dkav commented on September 25, 2024

On my end #17304 doesn't resolve the issue. ~/bundle reappears when running brew install-bundler-gems --add-groups=bottle. No folder is created in ~/Library/Caches/Homebrew, if that is the new location.

from brew.

carlocab avatar carlocab commented on September 25, 2024

What's the output of brew config and brew doctor?

from brew.

dkav avatar dkav commented on September 25, 2024

brew config

HOMEBREW_VERSION: 4.3.0-22-g56db99e
ORIGIN: https://github.com/Homebrew/brew
HEAD: 56db99e
Last commit: 3 hours ago
Core tap JSON: 15 May 16:39 UTC
Core cask tap JSON: 15 May 16:39 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CLEANUP_MAX_AGE_DAYS: 60
HOMEBREW_DEVELOPER: set
HOMEBREW_EDITOR: /opt/homebrew/bin/mvim
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_EMOJI: set
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_NO_UPDATE_REPORT_NEW: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit arm_ibiza
Clang: 15.0.0 build 1500
Git: 2.45.1 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

brew doctor

Your system is ready to brew.

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on September 25, 2024

~/bundle reappears when running brew install-bundler-gems --add-groups=bottle.

Do you have a ~/.bundle/config?

from brew.

dkav avatar dkav commented on September 25, 2024

Do you have a ~/.bundle/config?

No. The following is my .zprofile:

export BUNDLE_USER_CONFIG=$XDG_CONFIG_HOME/bundle/config
export BUNDLE_USER_PLUGIN=$XDG_DATA_HOME/bundle
export BUNDLE_USER_CACHE=$XDG_CACHE_HOME/bundle

Output from bundle config list:

Settings are listed in order of priority. The top value will be used.
user_cache
Set via BUNDLE_USER_CACHE: "/Users/xxx/.cache/bundle"

user_config
Set via BUNDLE_USER_CONFIG: "/Users/xxx/.config/bundle/config"

user_plugin
Set via BUNDLE_USER_PLUGIN: "/Users/xxx/.local/share/bundle"

I don't have a config file so the config folder doesn't exist and is not created.

from brew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.