# Maintaining compatibility with another version of Ruby that is already installed
# Remove this block if you want to just keep this version
( cd $PKG/usr/bin
mv ruby ruby2
mv rake rake2
mv irb irb2
mv gem gem2
mv erb erb2
mv rdoc rdoc2
mv ri ri2
)
He are the files in question:
root@fourteen_one[~]# head -n 1 /usr/bin/rake2
#!/usr/bin/ruby
root@fourteen_one[~]# head -n 1 /usr/bin/irb2
#!/usr/bin/ruby
root@fourteen_one[~]# head -n 1 /usr/bin/erb2
#!/usr/bin/ruby
root@fourteen_one[~]# head -n 1 /usr/bin/rdoc2
#!/usr/bin/ruby
root@fourteen_one[~]# head -n 1 /usr/bin/ri2
#!/usr/bin/ruby
root@fourteen_one[~]# head -n 1 /usr/bin/gem2
#!/usr/bin/ruby
This SlackBuild installs ruby in an alternate location to prevent itself from overwriting the official ruby binary installed with Slackware.
The "she bang" for each file moved during the build process needs to be patched so that it points to "#!/usr/bin/ruby2"
Relevant lines are 96-106 of file https://github.com/BrentonEarl/es1-slackware-stuff/blob/master/slackbuilds/ruby/ruby2/ruby2.SlackBuild
He are the files in question: