-
Notifications
You must be signed in to change notification settings - Fork 780
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
Fix Rubinius gem binstubs path #433
Conversation
Rubinius 2 insists that it installs RubyGems binstubs into `PREFIX/gems/bin` instead of `PREFIX/bin`. This creates complexity for rbenv rehash and exec processes, so we symlink `gems/bin` into `bin` and have RubyGems create binstubs at a location that is consistent with other Ruby implementations. See rbenv/rbenv#178, rbenv/rbenv#461
Perhaps figure out why the Rubinius team did this in the first place, and if there's a way to have |
@stouset They did it so that there is a separation of rbx's gem binstubs from those in Yes, rbenv could very easily query each ruby for its gem bindir. However, we don't want to go down that route since it would slow down the rehash process significantly. |
Use this script to fix your existing rbx installs in rbenv. It will symlink set -e
for prefix in "$(rbenv root)/versions"/rbx-*; do
gemdir="${prefix}/gems/bin"
bindir="${prefix}/bin"
if [ -d "$gemdir" ] && [ ! -L "$gemdir" ]; then
for file in "$gemdir"/*; do
[ -x "$file" ] && mv -v "$file" "$bindir"
done
rm -rf "$gemdir"
ln -hvs ../bin "$gemdir"
fi
done |
Thanks for fixing this, working with rbx-2.1.1 here. |
Thanks a lot! The rbx install was painful. |
@mislav thank you for that script, it is working for me. does this mean the script will need to be ran anytime a rehash is ran? |
With newer rbx installs + newer ruby-build, there is no issue anymore. My script above is just a workaround for people who had existing installs before we sorted this out. And no, this is a one-time operation. It doesn't need to be run before every rehash. |
Rubinius 2 insists that it installs RubyGems binstubs into
PREFIX/gems/bin
instead ofPREFIX/bin
.This creates complexity for rbenv rehash and exec processes, so we symlink
gems/bin
intobin
and have RubyGems create binstubs at a location that is consistent with other Ruby implementations.@sstephenson Right now this is done unconditionally. Should we only be doing this when ruby-build is invoked through rbenv-install? I'm wondering whether this might be unwanted by people who use ruby-build for non rbenv-related purposes.
See rbenv/rbenv#178, rbenv/rbenv#461