You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
I use ~/.rbenv —at least that's where the rubies and shims etc get installed, all rbenv plugins I have are from homebrew. Still, it didn't seem to install any gem from ~/.rbenv/default-gems (I tried installing 2.0.0-rc1).
The reason will be displayed to describe this comment to others. Learn more.
I just saw the caveat in the rbenv formula about setting $RBENV_ROOT, which I never did. In anycase, $RBENV_ROOT is undefined, and rbenv root says ~/.rbenv. I guess you saying that the config file is at $(rbenv root)/default-gems would be much more clear.
Anyway I tried both ~/.rbenv and /opt/homebrew/opt/rbenv/default-gems and neither works. I suspect rbenv-default-gems uses $RBENV_ROOT rather than what rbenv root says… there's already a pull request on the rbenv-default-gems side about that, I'll move the discussion there, rather than further spamming this commit :)
The reason will be displayed to describe this comment to others. Learn more.
I've been looking at how rbenv looks for plugins, executables, and command hooks.
The core of my problem was that I have Homebrew in /opt/homebrew, and rbenv knows only about /usr/local; patching it to look in $HOMEBREW_PREFIX makes rbenv-default-gems work even with the default $RBENV_ROOT.
The directories under $HOMEBREW_PREFIX/var/lib/rbenv/ also feel slightly wrong:
having versions/ under var is fine, but shims/ should go there too to be coherent; in fact those two should stay relative to wherever $RBENV_ROOT is
links under plugins/ are left broken if you remove the plugins; I guess that's because anything under var or etc is not tracked as part of the keg? I think we could remove it, since hooks are found as described above, and plugin binaries are linked into $HOMEBREW_PREFIX/bin anyway.
It seems like not much is needed to have a nicely flexible lookup policy that allows homebrew-packaged plugins with an arbitrary $RBENV_ROOT. It probably requires a couple small patches on @sstephenson's side, checking the plugins, & synchronized update of the homebrew formulas (I'll have a look, but I'm not sure in which order to submit all that to minimize hassle, and it's late :) )
The reason will be displayed to describe this comment to others. Learn more.
Submit a patch to rbenv about the /usr/local problem and we'll include it when they do. Makes sense about shims. Doesn't really matter if plugin links are broken; Homebrew doesn't have uninstall hooks to fix that anyway. The problem isn't plugin binaries but plugin hooks which won't be included unless linked into rbenv correctly.
If you can work on this it would be great. Even better would be a patch to rbenv to mean we don't have to make all the silly symlinks. Thanks!
The reason will be displayed to describe this comment to others. Learn more.
/usr/local is a simple inreplace in the formula. Does not make much sense to do that upstream.
About plugin links, I was thinking putting them somewhere in either of $HOMEBREW_PREFIX/{share,lib}/rbenv; I'm never really sure what the unixy conventions are for these sort of files.
The reason will be displayed to describe this comment to others. Learn more.
It would be good to get that as a rake option upstream if possible. They should be in var as that's what we use for changing stuff that's not kept in the Cellar.
The reason will be displayed to describe this comment to others. Learn more.
But what if e.g. rbenv-default-gems installs itself to prefix/share/rbenv/plugins/rbenv-default-gems/…, following the same principle than shell completion functions?
The reason will be displayed to describe this comment to others. Learn more.
ZSH and Bash completions are stored in different places and it would be a symlink rather than installation. I don't want to screw around with locations for just aesthetic reasons.
b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use
~/.rbenv
—at least that's where the rubies and shims etc get installed, all rbenv plugins I have are from homebrew. Still, it didn't seem to install any gem from~/.rbenv/default-gems
(I tried installing 2.0.0-rc1).b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I guess this needs to me more explicit. Thanks!
b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what's the solution?
How do I know if I'm "using homebrew's directories" or not?
b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved in 192bbb1. You are using Homebrew's directories.
b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw the caveat in the rbenv formula about setting
$RBENV_ROOT
, which I never did. In anycase,$RBENV_ROOT
is undefined, andrbenv root
says~/.rbenv
. I guess you saying that the config file is at$(rbenv root)/default-gems
would be much more clear.Anyway I tried both
~/.rbenv
and/opt/homebrew/opt/rbenv/default-gems
and neither works. I suspectrbenv-default-gems
uses$RBENV_ROOT
rather than whatrbenv root
says… there's already a pull request on the rbenv-default-gems side about that, I'll move the discussion there, rather than further spamming this commit :)b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been looking at how rbenv looks for plugins, executables, and command hooks.
The core of my problem was that I have Homebrew in
/opt/homebrew
, and rbenv knows only about/usr/local
; patching it to look in$HOMEBREW_PREFIX
makes rbenv-default-gems work even with the default$RBENV_ROOT
.The directories under
$HOMEBREW_PREFIX/var/lib/rbenv/
also feel slightly wrong:versions/
undervar
is fine, butshims/
should go there too to be coherent; in fact those two should stay relative to wherever$RBENV_ROOT
isplugins/
are left broken if you remove the plugins; I guess that's because anything undervar
oretc
is not tracked as part of the keg? I think we could remove it, since hooks are found as described above, and plugin binaries are linked into$HOMEBREW_PREFIX/bin
anyway.It seems like not much is needed to have a nicely flexible lookup policy that allows homebrew-packaged plugins with an arbitrary
$RBENV_ROOT
. It probably requires a couple small patches on @sstephenson's side, checking the plugins, & synchronized update of the homebrew formulas (I'll have a look, but I'm not sure in which order to submit all that to minimize hassle, and it's late :) )b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submit a patch to
rbenv
about the/usr/local
problem and we'll include it when they do. Makes sense aboutshims
. Doesn't really matter if plugin links are broken; Homebrew doesn't have uninstall hooks to fix that anyway. The problem isn't plugin binaries but plugin hooks which won't be included unless linked intorbenv
correctly.If you can work on this it would be great. Even better would be a patch to
rbenv
to mean we don't have to make all the silly symlinks. Thanks!b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/local
is a simple inreplace in the formula. Does not make much sense to do that upstream.About plugin links, I was thinking putting them somewhere in either of
$HOMEBREW_PREFIX/{share,lib}/rbenv
; I'm never really sure what the unixy conventions are for these sort of files.b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to get that as a rake option upstream if possible. They should be in
var
as that's what we use for changing stuff that's not kept in the Cellar.b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what if e.g. rbenv-default-gems installs itself to
prefix/share/rbenv/plugins/rbenv-default-gems/…
, following the same principle than shell completion functions?b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZSH and Bash completions are stored in different places and it would be a symlink rather than installation. I don't want to screw around with locations for just aesthetic reasons.
b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…what did you mean with "rake option"? there's no rakefile in rbenv 😕
b7f2f88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just noticed that. Good point, sad times :(