
By: Geri Coady – CC BY 2.0
目次
RVMのバージョンアップ
まずは、RVMのバージョンアップをする
1 | rvm get latest |
最新版で安定版は rvm get stable
Rubyのバージョンアップ
ruby 2.0.0として登録済みのものをp247からp353へバージョンアップする
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | rvm upgrade 2.0.0 Are you sure you wish to upgrade from ruby-2.0.0-p247 to ruby-2.0.0-p353? (Y/n): Installing new ruby ruby-2.0.0-p353 Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.9/x86_64/ruby-2.0.0-p353. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Installing requirements for osx. Updating system - please wait Installing required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libksba, openssl - please wait Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date. Requirements installation successful. Installing Ruby from source to: /Users/seven/.rvm/rubies/ruby-2.0.0-p353, this may take a while depending on your cpu(s)... ruby-2.0.0-p353 - #downloading ruby-2.0.0-p353, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10.2M 100 10.2M 0 0 3441k 0 0:00:03 0:00:03 --:--:-- 4159k ruby-2.0.0-p353 - #extracting ruby-2.0.0-p353 to /Users/seven/.rvm/src/ruby-2.0.0-p353 - please wait ruby-2.0.0-p353 - #extracted to /Users/seven/.rvm/src/ruby-2.0.0-p353 ruby-2.0.0-p353 - #configuring - please wait 16.13s user 16.22s system 92% cpu 34.909 total ruby-2.0.0-p353 - #post-configuration - please wait ruby-2.0.0-p353 - #compiling - please wait ruby-2.0.0-p353 - #installing - please wait Retrieving rubygems-2.1.11 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 358k 100 358k 0 0 663k 0 --:--:-- --:--:-- --:--:-- 1141k Extracting rubygems-2.1.11 ... - please wait Removing old Rubygems files... Installing rubygems-2.1.11 for ruby-2.0.0-p353 - please wait 10.19s user 0.46s system 99% cpu 10.749 total Installation of rubygems completed successfully. 10.80s user 1.05s system 86% cpu 13.742 total Saving wrappers to '/Users/seven/.rvm/wrappers/ruby-2.0.0-p353'........ - please wait ruby-2.0.0-p353 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake). ruby-2.0.0-p353 - #importing default gemsets, this may take time - please wait Install of ruby-2.0.0-p353 - #complete 867.36s user 191.01s system 84% cpu 20:53.97 total Ruby was built without documentation, to build it run: rvm docs generate-ri 867.74s user 191.45s system 84% cpu 20:57.18 total 868.06s user 191.76s system 84% cpu 20:57.72 total Migrating gems from ruby-2.0.0-p247 to ruby-2.0.0-p353 Are you sure you wish to MOVE gems from ruby-2.0.0-p247 to ruby-2.0.0-p353? This will overwrite existing gems in ruby-2.0.0-p353 and remove them from ruby-2.0.0-p247 (Y/n): Moving gemsets... Moving ruby-2.0.0-p247 to ruby-2.0.0-p353 Making gemset ruby-2.0.0-p353 pristine........................... Error running '__rvm_with ruby-2.0.0-p353 /Users/seven/.rvm/scripts/gemsets pristine', please read /Users/seven/.rvm/log/1386526485/gemset.pristine-ruby-2.0.0-p353.log Moving ruby-2.0.0-p247@global to ruby-2.0.0-p353@global Making gemset ruby-2.0.0-p353@global pristine.... Do you wish to move over aliases? (Y/n): Y Updating alias default to point to ruby-2.0.0-p353 Do you wish to move over wrappers? (Y/n): Y Do you also wish to completely remove ruby-2.0.0-p247 (inc. archive)? (Y/n): Y Removing ruby-2.0.0-p247............ Successfully migrated ruby-2.0.0-p247 to ruby-2.0.0-p353 220.34s user 71.04s system 80% cpu 6:00.47 total Upgrade complete! 1089.03s user 263.49s system 83% cpu 27:00.90 total |
2.0.0から2.1.0にバージョンアップ
書き換える場合
戻せないリスクがあります.メジャーなバージョンアップでは危険かも
1 | rvm upgrade 2.0.0 2.1.0 |
別にインストールしてgemsetのコピーしたほうがいいかも
まず、2.1.0をインストール
1 | rvm install 2.1.0 |
2.1.0をつかう
1 | rvm use 2.1.0 |
新しいRVMではpathの登録をするのに一度rvm useをつかう必要があるみたい.
Gemsetのコピー
1 | rvm gemset copy ruby2.0.0@global ruby2.1.0@global |
2.1.0をデフォルトでつかう
1 | rvm use 2.1.0 --default |
古いバージョンを削除
しばらく新しいバージョンをつかって古いバージョンを削除する場合は
1 | rvm remove 2.0.0 |
gemのバージョンアップ
1 2 | rvm reload ruby -v |
全部アップデートするときは
1 | gem update |
zshでデフォルトを設定してもシステムのrubyになってしまう現象
1 | rvm use 2.1.3 --default |
普通に–defaultオプションで指定
なぜか、ターミナルを再起動してもシステムのrubyになってしまう場合、うちはこれで直った.
1 | rvm get stable --auto-dotfiles |
stackoverflow.com/questions/4755538/rvm-is-not-working-in-zsh