CUBY logo

Compiling ruby

This page documents installation of ruby from source code by user without root privileges. Installing ruby from a package in your distribution is preferred, but compiling ruby yourself may be the only options in some special cases.

Following instructions are very basic and assume that everything works as it should, what requires having a C compiler and possibly some libraries installed.

  1. Download ruby source code. The installation of the latest version (1.9.3) is more complicated, these instruction apply for 1.9.2. Download the latest release from
  2. Unpack the archive
  3. Run "./configure"
  4. Run "make"
  5. Run "make test" to check if the binary works
  6. Set the environment for ruby: variable RUBYLIB should point to directories with libraries in your ruby installation. These are "lib", ".ext/common" and ".ext/your_architecture" (Example: export RUBYLIB=/home/yourname/ruby-1.8.7-p72/lib:/home/yourname/ruby-1.8.7-p72/.ext/common:/home/yourname/ruby-1.8.7-p72/.ext/x86_64-linux;).
  7. Add ruby to your PATH (Example: export PATH=/home/yourname/ruby-1.8.7-p72:$PATH).
  8. Make these settings permanent by adding them to startup script of your shell.
  9. Continue with Installation of cuby