본문 바로가기

Project 자료수집

"RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You have to source the RVM script into the current session because it makes changes to the shell environment - and it is absolutely impossible for that to be done from a child process. Your efforts at running RVM as an external command cannot succeed.

To actually fix this you have two choices:

  1. Configure your terminal emulator to start a login shell, rather than a non-login shell, so that your .profile is loaded.
  2. Modify .bashrc to source RVM instead, which works for non-login shells as well.

To do the second you can just add to ~/.bashrc:

if test -f ~/.rvm/scripts/rvm; then
    [ "$(type -t rvm)" = "function" ] || source ~/.rvm/scripts/rvm
fi