Search code examples
rubyrvmrbenv

Why does gem persist in installing to ~/.rvm after I've moved to rbenv?


I've decided to move away from rvm to rbenv on my personal machine. Followed the rvm removal instructions, installed rbenv and everything looks peachy. After restarting my shell session:

$ rbenv global
1.9.3-p0

$ ls .rvm
ls: cannot access .rvm: No such file or directory

$ rbenv exec gem list

*** LOCAL GEMS ***

A completely fresh install in a fresh shell--RVM's long gone. Now, when I install bundler

$ rbenv exec gem install bundler
Fetching: bundler-1.0.22.gem (100%)
Successfully installed bundler-1.0.22
1 gem installed

$ rbenv rehash

$ echo $?
0

$ rbenv which bundle
rbenv: bundle: command not found

What? Indeed, look at this nonsense:

$ ls .rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.22/
bin  bundler.gemspec  CHANGELOG.md  ISSUES.md  lib  LICENSE  man  Rakefile  README.md  spec  UPGRADING.md

Somehow, someway, RVM still has its hooks into me. My ~/.bash* files are clean and

$ cat ~/.gemrc 
gem: --no-ri --no-rdoc

I have no system ruby, no globally installed RVM (nothing in /etc/profile/, no /etc/profile.d/rvm.sh and nothing in /etc/bash.bashrc) and I'm at a complete loss.

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.11
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /home/blt/.rvm/gems/ruby-1.9.3-p0
  - RUBY EXECUTABLE: /home/blt/.rbenv/versions/1.9.3-p0/bin/ruby
  - EXECUTABLE DIRECTORY: /home/blt/.rvm/gems/ruby-1.9.3-p0/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/blt/.rvm/gems/ruby-1.9.3-p0
     - /home/blt/.rvm/gems/ruby-1.9.3-p0@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

Where else can I look to figure out why gem's configured to install to ~/.rvm?


Solution

  • Something's clearly rotten on my system; no grepping has turned it up, but tacking

    unset GEM_HOME
    unset GEM_PATH
    

    to the end of my ~/.bashrc made things sane. Horrible hack, though.