Rvm Is Not a Function, Selecting Rubies with 'Rvm Use ...' Will Not Work

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

Your console is not running as a login shell and hence have no access to rvm function. If you are running Ubuntu, you can:

  1. Open console
  2. Select Edit -> Profile Preferences
  3. Select tab: Title and Command
  4. Check box 'Run command as a login shell'
  5. Restart terminal

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

Turns out that RVM was installed in the wrong place. When I had initially installed RVM I believe I did so with the sudo command, which ran the multi-user install (installed to /usr/local/rvm), and not the single user (should be in ~/.rvm/scrips/rvm), which is why all the posted solutions were not working for me.

I had to uninstall RVM with rvm implode. There were some permissions issues, so I had to manually go in and delete the files that could not be deleted. Ran the curl command to re-install RVM and now it's installed in the correct place.

Sourcing RVM in my .zshrc with [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" now works properly and I can switch between rubies.

rvm installation not working: RVM is not a function

You are not using an login shell.

The process of enabling the login flag is described here, also some details on what a login shell is can be found here.

Thus, you need to check the option "Run as login shell" in the Gnome terminal's settings. It is required to open new terminal after this setting the flag.

Sometimes it is required to set the command to /bin/bash --login.


For remote connections it is important to understand the differene between running interactive ssh session and executing single commands.

While running ssh server and then working with the server interactively you are using login shell by default and it's all fine, but for ssh server "command" you are not using login shell and it would be required to run it with ssh server 'bash -lc "command"'.

Any remote invocation can have the same problem as executing single command with ssh.

RVM is not a function error

I didn't understand what ~/.profile does correctly; I needed to change ~/.bash_profile instead. Problem solved!

I'm getting RVM is not a function error on Mac OS X, and no posted solutions work

The solution ended up being on the RVM Help & Support page, in the ".bash_profile not being loaded on OSX" section. It seems that the issue was that I had my terminal set to open with the "default login shell" and when I changed it to instead open with the command "/usr/bash" in Preferences/Setup, "source ~/.rvm/scripts/rvm" started working, and rvm is now being recognized as a function.

Unable to create rvmrc, RVM is not a function, selecting rubies with 'rvm use ...' will not work

It could be you've corrupted your rvm installation somehow. It may be possible to fix it by wrecking around in the various shell script files it incorporates, but the easiest way to cure that problem is to re-install it.

If re-installing on top of your existing install doesn't work, try removing it completely before installing with:

rvm implode

It's usually best to create a new shell after it's been destroyed in order to start with a clean-slate. RVM has all kinds of hooks that can persist in any existing shells even after it's been imploded.

rvm is not a function with root user on ubuntu desktop

Add this to your .bashrc

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

If rvm is not in your home folder, you can use the absolute path

[[ -f "<path-to-rvm>/scripts/rvm" ]] && source "<path-to-rvm>/scripts/rvm"

RVM is not a function Ubuntu/Mina/rvm

This is most probabaly because rvm is still not loaded to your bash. Load it using:

source ~/.rvm/scripts/rvm 

followed by:

rvm use "ruby-2.2.2@default" --create

A permanent fix would be to add following line in your ~/.bashrc :

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"


Related Topics



Leave a reply



Submit