rvmでrubyのバージョンを切り替える
macbookproにrvmいれた。macportsにあるrvmというのはruby version managerとは関係ない別物なので注意
先にmacportsでreadlineをインストールしておく
sudo port install readline
git clone git://github.com/wayneeseguin/rvm.git
cd rvm
./install
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
rvm -v
1.0.1が入ってた
rvm list known
# MRI Rubies (ruby-)1.8.6(-p399) (ruby-)1.8.6-head (ruby-)1.8.7(-p302) (ruby-)1.8.7-head (ruby-)1.9.1-p243 (ruby-)1.9.1-p376 (ruby-)1.9.1(-p429) (ruby-)1.9.1-head (ruby-)1.9.2-preview1 (ruby-)1.9.2-preview3 (ruby-)1.9.2-rc1 (ruby-)1.9.2-rc2 (ruby-)1.9.2(-p0) (ruby-)1.9.2-head ruby-head # JRuby jruby-1.2.0 jruby-1.3.1 jruby-1.4.0 jruby-1.5.1 jruby(-1.5.2) jruby-head # Rubinius rbx(-1.0.1) rbx-head # Ruby Enterprise Edition ree-1.8.6 ree(-1.8.7) ree-1.8.6-head ree-1.8.7-head # MagLev maglev(-24067) maglev-head # Shyouhei head, the default mput mput(-head) # Mac OS X Snow Leopard Only macruby(-nightly) # the default macruby macruby-head # Build from the macruby git repository # IronRuby -- Not implemented yet. ironruby-0.9.3 ironruby-1.0-rc2 ironruby-head
とりあえず1.8.7と1.9.2を切り替えて使いたいので両方入れておいた
rvm install 1.9.2 rvm install 1.8.7
ちゃんと切り替えれるか確認
rvm list rvm use 1.9.2 ruby -v echo $GEM_HOME
gemも /Users/sho/.rvm/gems/ruby-1.9.2-p0 の下を参照しているので、入れ直す
gem list gem install twitter oauth