Linux HOWTOs

About | Home | Search

HOWTO: ruby
Description: Object-oriented scripting language
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# Ruby 1.8.6pl14
# ==============
# Slackware 11.0's 'ruby' package includes version 1.8.4, 12.0's includes
# 1.8.6

# Before there were Slackware packages for Ruby, this howto used to use
# the configure script's defaults (/usr/local) for installing Ruby, but
# now it puts it in /usr to match where Slackware puts it - so we don't
# break things that use Ruby.  If you have a /usr/local installed copy
# of Ruby, run something like "find /usr/local | grep ruby" and zap all
# of that.

# If you want to remove _everything_ from Ruby in /usr and /usr/local,
# skip down to the bottom.  That (in /usr) will include things that
# KDE packages put there.

# Prerequisites:
# bison
# groff

test -f installed/ruby-1.8.6-p114.tar.gz &&
 mv installed/ruby-1.8.6-p114.tar.gz .
test ! -f ruby-1.8.6-p114.tar.gz &&

# Verify tarball w/ md5sum:
echo "500a9f11613d6c8ab6dcf12bec1b3ed3  ruby-1.8.6-p114.tar.gz" | md5sum -c

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "ruby-*" -exec rm -r {} \;
tar xzvf ~/ruby-1.8.6-p114.tar.gz
cd ruby-1.8.6-p114
test $UID = 0 && chown -R root:root .

# If you don't want/need the 'rdoc' docs, or if you're in a hurry
# (it takes a while to generate them), leave off --enable-install-doc

./configure --prefix=/usr --datadir=/usr/share --mandir=/usr/man \
 --enable-shared --enable-install-doc
make test

# Become root to install it

# Remove the Slackware package, if there is one, old library files
test -x /sbin/removepkg && /sbin/removepkg ruby
rm -f /usr/lib/* /usr/lib/libruby-static.a

# Install it
make install

# Make sure your non-root account can remove the source later
chown -R $USER .
chmod -R u+w .

# Become your non-root self again

# To read Ruby-related info:
# Run 'man ruby'
# Run 'ri'
# Go to the Ruby web site (link at the top)

mkdir -p -m 0700 installed
rm -f installed/ruby-*.tar.*
mv ruby-1.8.6-p114.tar.gz installed/

# If you ever want to uninstall Ruby, this should do it:
for pfx in /usr /usr/local;
  ( cd ${pfx}/bin ; rm -f erb irb rdoc ri ruby testrb )
  test -d ${pfx}/lib/ruby && rm -r ${pfx}/lib/ruby
  test -d ${pfx}/lib/ruby_lib && rm -r ${pfx}/lib/ruby_lib
  rm -f ${pfx}/lib/libruby-static.a ${pfx}/man/man1/ruby.1
find ~/src -maxdepth 1 -type d -name "ruby-*" -exec rm -r {} \;
rm -f ~/installed/ruby-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>