From: Paul Lutus Date: 2006-11-25T17:20:13+09:00 Subject: Re: [Mac OS X] having three ruby versions installed Une b辿vue wrote: > on my box running Mac OS X (Tiger the latest) i do have three ruby > versions : > > - /usr/bin/ruby # Apple's default installed version : > # => 1.8.2 > - /opt/local/bin/ruby # the MacPort version : > # => 1.8.5 > - /Users/yvon/bin/jruby/jruby # svn installed > # => 1.8.5 (0) [java] > > both MacPort and SVN versions cohabit nicely because using zsh (shell) > aliases all commands of jruby have a "j" prefix and using a ~/.jgemrc > i'm able to switch env vars between them. > > then, the prob, reason for posting here, come with the default installed > version. > > here, when doing a : > $ /usr/bin/ruby wav2xml.rb bidule.wav # i get : > /usr/bin/ruby: No such file to load -- ubygems (LoadError) > > i think this is due to some env vars i setup : > export RUBYOPT=rubygems > export GEM_HOME=/opt/local/lib/gems/1.8 > export RUBYLIB=/opt/local/lib/ruby/:/opt/local/lib/ruby/site_ruby/1.8 > > because i've to design some scripts usable with apple's default version, > i'd like to find a workaround for that error message without installing > anything within Apple's ruby... > > do you have a trick for that ? Figure out what your search path is and symlink the desired Ruby version into the earliest (first searched) executable directory. Example. Let's say you have directory /usr/local/bin, and it is the first searched executable directory, and you want to execute /opt/local/bin/ruby instead of the Ruby version located at /usr/bin/ruby. Move to directory /usr/local/bin, type this as root: # ln -s /opt/local/bin/ruby ruby Then test whether this worked. As a normal user: $ ruby -version But having multiple Ruby versions installed is a bad idea, because the different versions use libraries, some of them shared, that may cause conflicts. -- Paul Lutus http://www.arachnoid.com