Mac環境にてrubyバージョン共存

rbenv

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

echo `export PATH="$HOME/.rbenv/bin:$PATH"` >> ~/.bash_profile

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

exec $SHELL -l

 

 

rbenv install -l

rbenv install 1.9.3-p448

rbenv rehash

 

export CPPFLAGS=-I/opt/X11/include

brew install apple-gcc42

CC=/usr/local/bin/gcc-4.2 rbenv install 1.8.7-p358

 

 

rbenv global 1.9.3-p448

rbenv global 1.8.7-p358