配置rvm和`bundler not installed'时出现问题

时间:2013-02-20 20:36:46

标签: rvm bundler

我是rvm遇到重大问题的新手。 bundle install给了我错误

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

即使我知道已安装,但如果我运行gem list -l则会显示。我怀疑它会返回一系列系统宝石,这表明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"

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

2 个答案:

答案 0 :(得分:1)

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

如果您没有找到任何内容,请尝试检入/etc

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

从评论中更新:

sed -i'' '/GEM_HOME=/ d;' ~/.bashrc
rm ~/.gemrc

答案 1 :(得分:0)

这个帮助了我

cd ~/.rvm/bin
rm bundle

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