CSIL installation
CS290F Fall 2006 - UCSB Computer Science - Thorsten von Eicken
Installing Ruby, RubgGems & PostgreSQL on your CSIL Account
The following lines of shell script should install ruby, rubygems (ruby's package/module management system), and postgresql (my personal database of choice) on your CSIL unix account without any special permissions. You accomplish this by installing all of the software under your home directory instead of the usual system directories. This is a standard trick for installing your own versions of software on systems where you don't have root. The place I typically install such software is under the directory $HOME/usr (c.f. /usr). You can change this location if you wish by changing the value of the PREFIX shell variable in the script below.
If you are installing this on your own Linux system, then you don't need to do the PREFIX=$HOME/usr trick, and can instead use PREFIX=/usr/local, which is what the configure scripts would default to without a --prefix option. You can also install these packages using your favorite package manager (rpm, yum, emerge, etc.). We have some experience with these approaches, should you encounter difficulties, but the diversity of packaging systems for Linux makes it impossible to outline all the installation procedures.
One problem you may encounter installing these packages under your CSIL account is a lack of disk space: you might exceed your quota by installing all of this under your home directory. There's three possible courses of action in this case:
- Delete some stuff in your account to make enough space.
- Install these programs somewhere besides $HOME/usr, for example /tmp/$USER/usr. However, this means that these programs will only be available on the local system you installed it on, and it may get deleted at some point when CS support reboots the machine and potentially cleans up the /tmp directory.
- Request a higher quota from CS support <support@cs>.
Without further ado, here's the script. Please let me (Stefan <sgk@cs>) know if you have any problems with it.
For those using cshell, add #!/bin/bash as the first line.
# install directories... SRCDIR=/tmp/$USER PREFIX=$HOME/usr PGDATA=$HOME/pgdata export PATH=$PREFIX/bin:$PATH unset RUBYOPT # install ruby... mkdir -p $SRCDIR cd $SRCDIR wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz tar zxvf ruby-1.8.5.tar.gz cd ruby-1.8.5 ./configure --prefix=$PREFIX make make test make install # install rubygems... cd $SRCDIR wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz tar zxvf rubygems-0.9.0.tgz cd rubygems-0.9.0 $PREFIX/bin/ruby setup.rb config --prefix=$PREFIX $PREFIX/bin/ruby setup.rb setup $PREFIX/bin/ruby setup.rb install # install the necessary gems... $PREFIX/bin/gem install -r xml-simple $PREFIX/bin/gem install -r activesupport $PREFIX/bin/gem install -r activerecord # install postgresql... cd $SRCDIR wget ftp://ftp.us.postgresql.org/pub/mirrors/postgresql/v8.1.4/postgresql-8.1.4.tar.bz2 tar jxvf postgresql-8.1.4.tar.bz2 cd postgresql-8.1.4 ./configure --prefix=$PREFIX make make install # create a database instance mkdir $PGDATA $PREFIX/bin/initdb --pgdata=$PGDATA $PREFIX/bin/pg_ctl -D $PGDATA -l $PGDATA/logfile start && sleep 2 $PREFIX/bin/createdb $USER $PREFIX/bin/psql
