在RVM,El Capitan 10.11中,gem安装失败

时间:2015-12-17 10:11:06

标签: ruby gem rvm

这是因为环境中的空GEM_HOME变量吗? 我几个小时都无法理解......

➜  ~  gem install mysql
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory -
➜  ~  mysql --version
mysql  Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using  EditLine wrapper
➜  ~  gem install mysql2
Fetching: mysql2-0.4.2.gem (100%)
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory -
➜  ~  rvm info

system:

  system:
    uname:       "Darwin Seos-MacBook.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64"
    system:      "osx/10.11/x86_64"
    bash:        "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)"
    zsh:         "/bin/zsh => zsh 5.0.8 (x86_64-apple-darwin15.0)"

  rvm:
    version:      "rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "21 minutes 30 seconds ago"
    path:         "/Users/seoyoochan/.rvm"

  homes:
    gem:          "not set"
    ruby:         "not set"

  binaries:
    ruby:         "/usr/bin/ruby"
    irb:          "/usr/bin/irb"
    gem:          "/usr/bin/gem"
    rake:         "/usr/bin/rake"

  environment:
    PATH:         "/Users/seoyoochan/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin"
    GEM_HOME:     ""
    GEM_PATH:     ""
    MY_RUBY_HOME: ""
    IRBRC:        ""
    RUBYOPT:      ""
    gemset:       ""


➜  ~

1 个答案:

答案 0 :(得分:0)

感谢评论家伙们,我自己就修好了。

当我检查宝石的版本时,它很老(可能是2.0.4) 尝试gem update --system也失败了,所以我添加了sudo

sudo gem update --system确实解决了这个问题。