Liz's Blog

更新rvm不成那就打掉重練吧

| Comments

最近因為幾個測試環境都要Ruby版本要2.3以上,我的還停留在2.2.0,想利用rvm這個ruby管理工具來更新,跑了:rvm list known,竟然跑出類似這個Archives path '/usr/share/rvm/archives' not writable, aborting.訊息,爬了一下文似乎沒什麼解決辦法。

想跑rvm get stable,試試看可不可以更新rvm版本,也是跑出類似的訊息。所以想說直接砍掉rvm,重新安裝會比較好,雖然同時會失去本來rvm的資料,但至少比完全不能更新好。

刪除步驟是參考這篇
1.先告訴rvm要自爆了:rvm implode
2.解除安裝rvm這個gem:gem uninstall rvm
確認RVM已經從路徑上消失,並且確認RVM已經在這些路徑中.bashrc.bash_profile.profile被移除了。
3.檢查.rvm、.rvmrc有沒有被移除:ls -a ~
4.還沒的話,可以使用rm -rf來強制刪除。

rm -rf .rvm
rm -rf .rvmrc

1.再把rvm裝回來就好,輸入:
\curl -sSL https://get.rvm.io | bash -s stable

2.看有哪些Ruby可以安裝。
rvm list known

3.Ruby是可以省略的,直接輸入版本即可,可參考這篇說明
rvm install 2.3

4.檢查版本。
ruby -v

5.可檢查rvm設定。
rvm info

ruby-2.3.3:

  system:
    uname:        "Darwin huangzhaocideMacBook-Air.local 14.5.0 Darwin Kernel Version 14.5.0: Sun Jun  4 21:40:08 PDT 2017; root:xnu-2782.70.3~1/RELEASE_X86_64 x86_64"
    name:         "OSX"
    version:      "10.10"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)"
    zsh:          "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"
    remote path:  "osx/10.10/x86_64"

  rvm:
    version:      "rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]"
    updated:      "1 hour 1 minute 1 second ago"
    path:         "/usr/local/rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.3.3p222"
    date:         "2016-11-21"
    platform:     "x86_64-darwin14"
    patchlevel:   "2016-11-21 revision 56859"
    full_version: "ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin14]"

  homes:
    gem:          "/usr/local/rvm/gems/ruby-2.3.3"
    ruby:         "/usr/local/rvm/rubies/ruby-2.3.3"

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-2.3.3/bin/ruby"
    irb:          "/usr/local/rvm/rubies/ruby-2.3.3/bin/irb"
    gem:          "/usr/local/rvm/rubies/ruby-2.3.3/bin/gem"
    rake:         "/usr/local/rvm/rubies/ruby-2.3.3/bin/rake"

  environment:
    PATH:         "/usr/local/rvm/gems/ruby-2.3.3/bin:/usr/local/rvm/gems/ruby-2.3.3@global/bin:/usr/local/rvm/rubies/ruby-2.3.3/bin:/usr/local/rvm/bin:/Users/LizHuang/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
    GEM_HOME:     "/usr/local/rvm/gems/ruby-2.3.3"
    GEM_PATH:     "/usr/local/rvm/gems/ruby-2.3.3:/usr/local/rvm/gems/ruby-2.3.3@global"
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.3.3"
    IRBRC:        "/usr/local/rvm/rubies/ruby-2.3.3/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

Comments

comments powered by Disqus