If you've got some apps you've done in 1.8.7 but want to also begin some dev in 1.9.1 here's how I did it:
(Assuming you've already got Ruby 1.8.7 or some other version - I won't go over that, archcoder never looks back)
Step one
Be cool, get brew (teh' line below is {ruby = command}, {-e = one line ruby command script}, {"$(curl....) = install brew from files stored on github})ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
Step two
Get the awesomeness that is Ruby 1.9.1 (was at 2010-01-10 revision 26273 when I wrote this) (teh' line below is {sudo = run command as root}, {brew = command for the install helper brew}, {install = command to install}, {ruby = package to install - defaults to latest}sudo brew install ruby
Step three
Modify your bashrc to make transitions between the two easier (teh' line below is {mate = I use textmate to edit files, you could use vim or something else if you're that cool},{ /etc/bashrc = default location for my bashrc file}mate /etc/bashrc
Add the following lines to the file and save it (I added mine just under the last "alias" declaration):
Note: You might need to change the paths depending on location and version installed
#code alias irb191='/usr/local/Cellar/ruby/1.9.1-p378/bin/irb --readline -r irb/completion' alias ruby191='/usr/local/Cellar/ruby/1.9.1-p378/bin/ruby'
Step four
Now open a terminal window and issue teh' following command: (teh' line below is {source = tells terminal to use the newly saved file})source /etc/bashrc
Tip: I've added an alias for the reload as well:
alias reload='source /etc/bashrc'
Step five
Use it - open up terminal and type:ruby -v
Then type:
ruby191 -v
You should see something like:
You can do the same with irb (Ruby's interactive console)
irb
irb191