0

我是一个新手,对 rvm 有很大的问题。bundle install给我错误

`ERROR: Gem bundler is not installed, run `gem install bundler` first.

即使我知道它安装,但如果我运行gem list -l. 我怀疑这会返回一个系统 gem 列表,这表明 rvm 绝对是问题所在。再试gem install bundler一次也没有用。我环顾了其他有类似问题的人,但找不到对我所处的任何情况都有帮助的答案。rvm info给了我这个输出:

# rvm info

system:

  system:
    uname:       "Linux box576.bluehost.com 2.6.32-20130101.60.1.bh6.x86_64 #1 SMP Tue Jan 1 22:59:09 EST 2013 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "unknown/libc-2.12/x86_64"
    bash:        "/ramdisk/bin/bash => GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)"
    zsh:         "/usr/bin/zsh => zsh 4.3.10 (x86_64-redhat-linux-gnu)"

  rvm:
    version:      "rvm 1.18.8 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "22 hours 59 minutes ago"

  homes:
    gem:          "/home7/contenw6/ruby/gems"
    ruby:         "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194"

  binaries:
    ruby:         "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/rake"

  environment:
    PATH:         "/usr/local/jdk/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@projecta/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@global/bin:/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin:/home7/contenw6/.rvm/bin:/home7/contenw6/perl5/bin:/usr/lib64/qt-3.3/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/bin"
    GEM_HOME:     "/home7/contenw6/ruby/gems"
    GEM_PATH:     "/home7/contenw6/ruby/gems:/usr/lib/ruby/gems/1.8"
    MY_RUBY_HOME: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

如果我做rvm use 1.9.3-p194@projecta --default环境部分现在看起来像这样:

  environment:
    PATH:         "/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@projecta/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@global/bin:/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin:/home7/contenw6/.rvm/bin:/usr/local/jdk/bin:/home7/contenw6/perl5/bin:/usr/lib64/qt-3.3/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/bin"
    GEM_HOME:     "/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@projecta"
    GEM_PATH:     "/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@projecta:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       "projecta"

但是当我登录并重试时,它会恢复到上面的第一个输出。我显然在某个地方搞砸了,我不知道如何修复我的安装或问题出在哪里。任何帮助将不胜感激。

4

2 回答 2

1

这看起来像您以前的 ruby​​ 设置,请检查您的~/.bashrc~/.zshenv可能包含上述路径的任何变量集

如果您没有找到任何东西,请尝试签入/etc

grep -rn "/home7/contenw6/ruby/gems" /etc

从评论更新:

sed -i'' '/GEM_HOME=/ d;' ~/.bashrc
rm ~/.gemrc
于 2013-02-20T21:12:55.140 回答
0

这个对我有帮助

cd ~/.rvm/bin
rm bundle

然后返回到你的项目文件夹安装一个 bundler gem 并运行 bundle w/o 问题

于 2013-02-21T08:35:05.753 回答