rvm installation not working: "RVM is not a function"
To permanently resolve this just cut/paste following line:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
From: ~/.bash_profile
file
To: ~/.bashrc
file
Reason this works is that .bashrc
is executed each time you enter the terminal, and .bash_profile
each time you login. That is why solution /bin/bash --login
works, but you have to do that each time you enter the terminal. This way you are set until your next format, and you will forget all this by than :)
You need to run the following
$ source ~/.rvm/scripts/rvm
then run this
$ type rvm | head -n 1
and if you get
rvm is a function
the problem is solved.
You also need to run user$ rvm requirements
to see dependency requirements for your operating system
Source: https://rvm.io/rvm/install/
I forget mention that you need to put this code into you ~/.bashrc or ~/.zshrc file and you will not need to write this code again. Cheers!
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
.