Skip to content

Instantly share code, notes, and snippets.

@sepastian
Last active December 18, 2015 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sepastian/5695396 to your computer and use it in GitHub Desktop.
Save sepastian/5695396 to your computer and use it in GitHub Desktop.
Compiling Ruby 1.8.4 with Tcl/tk support and Rubygems-0.9.0 (plus several ancient gems) under Ubuntu 13.04
# Compiling Ruby 1.8.4 with Tk from source under Ubuntu 13.04
# Install Rubygems 0.9.0 from source and various gems
# Download sources
~$ cd build
~/build$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz
~/build$ wget http://prdownloads.sourceforge.net/tcl/tcl8.5.14-src.tar.gz
~/build$ wget http://prdownloads.sourceforge.net/tcl/tk8.5.14-src.tar.gz
~/build$ wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
~/build$ tar xf ruby-1.8.4.tar.gz
~/build$ tar xf tcl8.5.14-src.tar.gz
~/build$ tar xf tk8.5.14-src.tar.gz
~/build$ tar xf rubygems-0.9.0.tgz
# Compile Tcl
~/build$ cd ~/build/tcl8.5.14
~/build/tcl8.5.14$ ./configure --prefix=/home/USER/DEST/tcl8.5.14
~/build/tcl8.5.14$ make
~/build/tcl8.5.14$ make install
# Compile Tk
~/build/tcl8.5.14$ cd ~/build/tk8.5.14
~/build/tk8.5.14$ ./configure --with-tcl=../tcl8.5.14/unix --prefix=/home/USER/DEST/tk8.5.14
~/build/tk8.5.14$ make
~/build/tk8.5.14$ make install
# Compile Ruby
~/build/tk8.5.14$ cd ~/build/ruby-1.8.4
~/build/ruby-1.8.4$ ./configure --prefix=/home/USER/DEST/ruby-1.8.4 --enable-pthread --with-tcl-include=/home/USER/DEST/tcl8.5.14/include --with-tk-include=/home/USER/DEST/tk8.5.14/include --with-tk --with-tkutil --with-tcl
~/build/ruby-1.8.4$ make
~/build/ruby-1.8.4$ make install
# Test the Tk gem
~/build/ruby-1.8.4$ /home/user/ruby-1.8.4/bin/irb
irb(main):001:0> require 'tk'
=> true
# Compile Rubygems
~/build/ruby-1.8.4$ cd ~/build/rubygems-0.9.0
~/build/rubygems-0.9.0$ /home/USER/DEST/ruby-1.8.4/bin/ruby setup.rb
# Fix Shebang for gem executables in /home/USER/DEST/ruby-1.8.4/bin
~/build/rubygems-0.9.0$ cd /home/USER/DEST/ruby-1.8.4/bin
~/DEST/ruby-1.8.4/bin$ for f in $(grep -lr "env ruby"); do sed -i 's|^#!/usr/bin/env ruby|#!/home/USER/DEST/ruby-1.8.4/bin/ruby|' $f; done
~/DEST/ruby-1.8.4/bin$ gem -v
0.9.0
# Install gems.
~/DEST/ruby-1.8.4/bin$ ./gem install PACKAGE.gem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment