I just installed RVM, but can't make it work. I have such line at the end of my .profile
file:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
I tried to run source .profile
and restarting terminal, but still, when I run rvm use 1.9.2
I'm getting:
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
My system is Ubuntu 11.10.
Procedure for installing Ruby 1.9.3-p125 on Mac OSX 10.8 Mountain Lion
http://www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/
Notes:
To install ruby, you may need to specify the clang compiler:
$ rvm install 1.9.3p125 --with-gcc=clang
If RVM gripes about /usr/local/rvm not found, you need to create a link:
$ ln -s /Users/[your user name]/.rvm /usr/local/rvm
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 forssh server "command"
you are not using login shell and it would be required to run it withssh server 'bash -lc "command"'
.Any remote invocation can have the same problem as executing single command with
ssh
.To permanently resolve this just cut/paste following line:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
From:
~/.bash_profile
fileTo:
~/.bashrc
fileReason this works is that
.bashrc
is executed each time you enter 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 terminal. This way you are set until your next format, and you will forget all this by then :)I had this problem too on a fresh rvm installation, and non of the answers here fixed it. Going into the official rvm site, on the basics section, they have this command:
You should change 1.9.3 for the ruby version that you actually want, and it'll make rvm a function regardless of the shell type.
For those who comes with same issue and they are using lubuntu like me I followed this link :
You start your terminal with
Thank to @mpapsis who pointed me to the right direction
« Official » instructions are there: https://rvm.io/integration/gnome-terminal/