While executing this command to install rvm
curl -sSL https://get.rvm.io | bash -s stable
I am getting this error message:
mktemp: failed to create file via template ‘/usr/share/rvm/rvm-exec-test.XXXXXX’: Permission denied
I solved it by changing the following
curl -sSL https://get.rvm.io | bash -s stable
into
curl -sSL https://get.rvm.io | sudo bash -s stable
The user needs access to the subdir. /usr/local
You probably have (or had) a system-wide installation of RVM. That can be due installing it through a package system like apt-get on Ubuntu or pacman on Arch Linux (both have rvm packages).
Check your environment variables:
> env | grep rvm_path
If you have it, then unset it and try to install again:
> unset rvm_path
> curl -sSL https://get.rvm.io | bash -s stable
BEWARE! If you still have rvm installed system-wide, this can give you unpredictable results, make sure you have it uninstalled before doing that.
If you have it already uninstalled and rvm_path is still there, maybe you can log out and log in again to remove them from the environment (or just restart the computer).
unset GEM_HOME
– jonathan
May 07 '18 at 14:54
Probably you had install another version of RVM in your computer. Check, if you have Ubuntu, maybe you installed the exclusive Ubuntu version https://github.com/rvm/ubuntu_rvm You can uninstall it with command
sudo apt-get purge rvm
I resolve it like this. And then install rvm with
\curl -sSL https://get.rvm.io | bash -s stable
And then configuring the source from
source ~/.rvm/scripts/rvm
You then need yo add the source of rvm to your .bashrc and .profile files in your home
I followed these steps and it works for me:
sudo apt purge ruby rvm
sudo rm -f /etc/rvmrc
mkdir -p $HOME/.rvm
curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles --user-install
Additional arguments:
--ignore-dotfiles: Avoid the execution of any previous .rvmrc file.
--user-install: The installation will be done in the path $HOME/.rvm
source $HOME/.rvm/scripts/rvm
The $ suggests you are attempting this install as a regular (i.e. non-root) user. If so, that is likely your problem, as the /usr/share/ tree on most Linux operating systems is writable only by root. The software you are trying to install likely wants you to have root permissions to perform the install.