Ruby はたまにバージョンアップします。 rvm で管理しているときは、こんな感じで更新します。

rvm の更新

rvm get head で rvm を最新にします。

#pre{{ iMac:~ sugimura$ rvm get head

Original installed RVM version:

rvm 1.6.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

remote: Counting objects: 2364, done. remote: Compressing objects: 100% (841/841), done. remote: Total 2270 (delta 1536), reused 2089 (delta 1356) Receiving objects: 100% (2270/2270), 331.15 KiB | 274 KiB/s, done. Resolving deltas: 100% (1536/1536), completed with 45 local objects. From git://github.com/wayneeseguin/rvm

* branch            master     -> FETCH_HEAD

... }}

対象の Ruby が増えていることを確認

rvm list known すると、インストールできる Ruby が増えていることがわかります。 ここでは 1.9.2-p290 が新しく追加されました。

#pre{{ iMac:~ sugimura$ rvm list known

# MRI Rubies [ruby-]1.8.6[-p420] [ruby-]1.8.6-head [ruby-]1.8.7[-p352] [ruby-]1.8.7-head [ruby-]1.9.1-p378 [ruby-]1.9.1[-p431] [ruby-]1.9.1-head [ruby-]1.9.2-p180 [ruby-]1.9.2[-p290] [ruby-]1.9.2-head [ruby-]1.9.3-head ruby-head ... }}

Ruby の更新

1.9.2-p180 を 1.9.2-p290 にしてみます。upgrade を使えば簡単です。

#pre{{ iMac:~ sugimura$ rvm upgrade 1.9.2-p180 1.9.2-p290 Are you sure you wish to upgrade from ruby-1.9.2-p180 to ruby-1.9.2-p290? (Y/n): y Installing new ruby ruby-1.9.2-p290 Installing Ruby from source to: /Users/sugimura/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)... ... Install of ruby-1.9.2-p290 - #complete Migrating gems from ruby-1.9.2-p180 to ruby-1.9.2-p290 Are you sure you wish to MOVE gems from ruby-1.9.2-p180 to ruby-1.9.2-p290? This will overwrite existing gems in ruby-1.9.2-p290 and remove them from ruby-1.9.2-p180 (Y/n): y Moving gemsets... Moving ruby-1.9.2-p180 to ruby-1.9.2-p290 Making gemset ruby-1.9.2-p290 pristine. Moving ruby-1.9.2-p180@global to ruby-1.9.2-p290@global Making gemset ruby-1.9.2-p290@global pristine. Do you wish to move over aliases? (Y/n): y Do you wish to move over wrappers? (Y/n): y Do you also wish to completely remove ruby-1.9.2-p180 (inc. archive)? (Y/n): y Successfully migrated ruby-1.9.2-p180 to ruby-1.9.2-p290 Upgrade complete! iMac:~ sugimura$ }}

更新されたことを確認

正しく 1.9.2-p290 になっていることを確認します。

#pre{{ iMac:~ sugimura$ rvm use 1.9.2 Using /Users/sugimura/.rvm/gems/ruby-1.9.2-p290 iMac:~ sugimura$ ruby --version ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] }}

gem も移行できています。 しばらく新しいのを入れていなかったので、この例は少々古いです。

#pre{{ iMac:~ sugimura$ gem list

LOCAL GEMS ***

abstract (1.0.0) actionmailer (3.0.4, 3.0.3) actionpack (3.0.4, 3.0.3) activemodel (3.0.4, 3.0.3) ... }}



トップ   差分 履歴 リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2011-07-30 (土) 23:45:52