I suspect a problem with your .bashrc. It should not contain:
# If I don't set this, gem reverts back to nonexistent RVM directory. export GEM_HOME=$(ruby -e 'print Gem.user_dir') export GEM_PATH=$(ruby -e 'print Gem.user_dir') export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
Of my ~ / .bashrc, ~ / .profile and ~ / .bash_profile files, only the latter has a configuration for rbenv:
# echo Using rbenv... export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
This was created when I installed rbenv, which matches the settings for my other systems on which I use rbenv, including those that were previously installed by RVM.
Your dual PATH assignments look like a criminal. Compare PATH for my system with yours specified in gem env :
- /Users/ttm/.rbenv/versions/2.2.3/bin - /Users/ttm/.rbenv/libexec - /Users/ttm/.rbenv/plugins/ruby-build/bin - /Users/ttm/.rbenv/plugins/rbenv-whatis/bin - /Users/ttm/.rbenv/plugins/rbenv-vars/bin - /Users/ttm/.rbenv/plugins/rbenv-use/bin - /Users/ttm/.rbenv/plugins/rbenv-update/bin - /Users/ttm/.rbenv/plugins/rbenv-update-rubies/bin - /Users/ttm/.rbenv/plugins/rbenv-gemset/bin - /Users/ttm/.rbenv/plugins/rbenv-env/bin - /Users/ttm/.rbenv/plugins/rbenv-each/bin - /Users/ttm/.rbenv/shims - /Users/ttm/.rbenv/bin
Similarly, my which pry returns:
/Users/ttm/.rbenv/shims/pry
Using the rbenv env plugin shows:
RBENV_VERSION=2.2.3 RBENV_GEMSET_ALREADY=yes RBENV_ROOT=/Users/ttm/.rbenv RBENV_HOOK_PATH=:/Users/ttm/.rbenv/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks:/Users/ttm/.rbenv/plugins/rbenv-default-gems/etc/rbenv.d:/Users/ttm/.rbenv/plugins/rbenv-gemset/etc/rbenv.d:/Users/ttm/.rbenv/plugins/rbenv-readline/etc/rbenv.d:/Users/ttm/.rbenv/plugins/rbenv-vars/etc/rbenv.d PATH=/Users/ttm/.rbenv/versions/2.2.3/bin:/Users/ttm/.rbenv/libexec:/Users/ttm/.rbenv/plugins/ruby-build/bin:/Users/ttm/.rbenv/plugins/rbenv-whatis/bin:/Users/ttm/.rbenv/plugins/rbenv-vars/bin:/Users/ttm/.rbenv/plugins/rbenv-use/bin:/Users/ttm/.rbenv/plugins/rbenv-update/bin:/Users/ttm/.rbenv/plugins/rbenv-update-rubies/bin:/Users/ttm/.rbenv/plugins/rbenv-gemset/bin:/Users/ttm/.rbenv/plugins/rbenv-env/bin:/Users/ttm/.rbenv/plugins/rbenv-each/bin:/Users/ttm/.rbenv/shims:/Users/ttm/.rbenv/bin:/Users/ttm/.pyenv/shims:/Users/ttm/.pyenv/bin:/Users/ttm/perl5/perlbrew/bin:/Users/ttm/perl5/perlbrew/perls/perl-5.18.1/bin:/Users/ttm/bin:/usr/local/mysql-5.6.16-osx10.7-x86_64/bin:/Users/ttm/libsmi/bin:/usr/local/git/bin:/usr/local/bin:/Library/PostgreSQL/9.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin RBENV_SHELL=bash RBENV_DIR=/Users/ttm RUBYLIB=/Users/ttm/.rbenv/rbenv.d/exec/gem-rehash:
I would take the following steps:
- Modify ~ / .bashrc and others by removing any lines related to rbenv and / or RVM. RVM uses all three init files, plus .zshrc, while rbenv only seems to concern ~ / .bash_profile.
- Close the terminal session. Restore it.
- Confirm that PATH is free of all references to RVM and rbenv.
- Reinstall rbenv according to the Installation instructions. It will not undo the current installation, but instead will reinstall the changes to the ~ / .bash_profile file.
- Close the terminal session again and open it again.
rbenv must be properly initialized.
source share