From: Igor Pirnovar Date: 2009-04-05T23:55:00+09:00 Subject: Re: How to get "irb1.8" using Ruby1.8 instead of Ruby1.9.1 ? I単aki Baz Castillo wrote: > When compiling and installing Ruby1.9.1 from sources, it created > /usr/bin/ruby > and /usr/bin/irb. The above clearly shows that the compilation messed up the links in your /usr/bin. Different versions of ruby and irb binaries must be stored as /usr/bin/ruby1.8, /usr/bin/irb1.8 and /usr/bin/ruby1.9, /usr/bin/irb1.9. On the other hand /usr/bin/ruby and /usr/bin/irb must be links and not binaries. Your compilation removed the links and installed binaries in their place. The solution to your problem is identification of the versions of the binaries and name them correctly as explained above. Remove or move away the old /usr/bin/ruby and /usr/bin/irb. Linking a version to a name without the version numbers is optional, but when you do the links, that must be done consistently and most importantly in the right direction (make sure you always link the number name (first argument) to non-number name (second argument) in the link command: i.e. {{ ln -s /usr/bin/ruby1.9 /use/bin/ruby }}). Of course the non-name argument must not exist (must be removed) before you run the {{ ln -s ... }}, otherwise the link command will fail. For your convenience you can create a script to relink your binaries to whichever version you like. Following is the link_ruby file I use: #!/bin/bash if [ $# -eq 0 ]; then version=9 else case $1 in -h|-H) echo "usage: $(basename $0) -8|-9 | [-h]"; exit;; 8|-8) version=8;; 9|-9) version=9;; *) echo Illegal argument; exit;; esac fi if [ $version = 9 ] ;then echo Currently your ruby version is 1.9 rm /usr/bin/ruby ln -s /usr/bin/ruby1.9 /usr/bin/ruby rm /usr/bin/irb ln -s /usr/bin/irb1.9 /usr/bin/irb else echo Currently your ruby version is 1.8 rm /usr/bin/ruby ln -s /usr/bin/ruby1.8 /usr/bin/ruby rm /usr/bin/irb ln -s /usr/bin/irb1.8 /usr/bin/irb fi -- Posted via http://www.ruby-forum.com/.