Commit 392679a7 by Mislav Marohnić

Fix `irb`, `rake`, `rdoc`, `ri` for rbx-2.2.1

We symlink Rubinius' `PREFIX/gems/bin` into `PREFIX/bin` so that new
RubyGems binstubs get added to the main bin directory and therefore
become available to rbenv.

However, by throwing away `irb`, `rake`, `rdoc`, and `ri` binstubs
during this process (which are non-executable and have an invalid
shebang), we break the same commands in latest versions of Rubinius.

This change ensures that these binstubs get preserved, their shebang
corrected to `#!PREFIX/bin/rbx`, their executable bit flipped on, and
copied over to the main bin directory.

Fixes #468
parent a2d9ac49
......@@ -537,10 +537,14 @@ fix_rbx_gem_binstubs() {
local prefix="$1"
local gemdir="${prefix}/gems/bin"
local bindir="${prefix}/bin"
local file binstub
# Symlink Rubinius' `gems/bin/` into `bin/`
if [ -d "$gemdir" ]; then
for file in "$gemdir"/*; do
[ -x "$file" ] && mv "$file" "$bindir"
binstub="${bindir}/${file##*/}"
rm -f "$binstub"
sed -E "s:^#\!.+:#\!${bindir}/ruby:" < "$file" > "$binstub"
chmod +x "$binstub"
done
rm -rf "$gemdir"
ln -s ../bin "$gemdir"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment