NOTE: I don't keep Ruby Switcher updated anymore. Use RVM instead.
I took some time this morning to get a similar setup working. Now, on my prompt, I type,
use_ruby_191 to go back and forth between the Ruby 1.8.6 shipped with Leopard and a self-compiled install of ruby 1.9.1.
Steps for you to get there:
- Compile and install ruby 1.9.1:
mkdir -p ~/tmp cd ~/tmp curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.gz tar xzf ruby-1.9.1-p0.tar.gz cd ruby-1.9.1-p0 ./configure --prefix=$HOME/.ruby_versions/ruby_191 make make install
- Install the ruby switcher:
curl -L http://github.com/relevance/etc/tree/master%2Fbash%2Fruby_switcher.sh?raw=true?raw=true > ~/ruby_switcher.sh echo "source ~/ruby_switcher.sh" >> ~/.bash_profile
Note that I use ~/.gem for my gems. If you don't do that, you'll have to modify the switcher to specify your
gem env and look for GEM PATHS to figure out what you should set it to.