7
votes

Question is very simple:

I cannot install RVM (single-user installation), as if I follow the instructions on the RVM website, that is:

$ curl -L https://get.rvm.io | bash -s stable 

I get a permission denied error at line 360 of the installation script file (the line that starts with echo):

# Perform the actual installation, first we obtain the source using whichever
# means was specified, if any. Defaults to head.
  case "${version}" in  
    (head) 
       echo "${branch}" > "$rvm_path/RELEASE"    
       install_head ${branch:-master} || exit $?  
  ;;

Here is the error message:

olivier@~$ curl -L https://get.rvm.io | bash -s stable

bash: line 360: /usr/local/rvm/RELEASE: Permission denied

If I add "sudo" before "bash" in the command above, it works fine, but it is then the multi-user install ...

4
@Sergio: added part of the installation script that poses problemcitraL
I suspect that your ~/.rvm dir exists and you don't have write access to it. Delete it and retry.Sergio Tulentsev
It would be helpful if you included the actual error message.Mark Thomas
@Mark: Added the error message ... Reading the message from Sergio, he might be guessing right, but the single-user install should access ~/.rvm not /usr/local/rvm no ? (the latter being for multi-user install)citraL

4 Answers

10
votes

Indeed, I solved this by uninstalling old versions of RVM: sudo rvm implode and then deleting the file /etc/rvmrc. Once done, I could install the single-user version and everything worked fine!

Sorry Remear, I wanted to edit your answer or complete it via my comment but I could not (comment can only be edited within 5 minutes...at least I upvoted...).

7
votes

Once you have a system-wide install, you can't run a single-user install as it will detect your system-wide install first and try to update it.

But it is possible to have a root install & then user install by specifying the installation path :

curl -sSL https://get.rvm.io | bash -s stable --path $HOME/.rvm

You will also have to set the single-user install path in your user path manually as RVM does not create it when you already have a system-wide install (not really an intended use) :

# .bashrc
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

And also load your user rvm :

# .bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
2
votes

Are you setting rvm_path in ~/.rvmrc, or in /etc/rvmrc, or in one of your bash scripts? I'd recommend removing both of those files as well as ~/.rvm and then try installing rvm again WITHOUT sudo.

0
votes

this work for me, first uninstall all versions and then as user (NO root) follow the next commands:

For example, I'm using Ruby 2.6.3 and Rails 5.2.2 and setting up helping a little in these web pages:

https://gorails.com/setup/ubuntu/20.04

https://rvm.io/rvm/install

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles

$ source ~/.rvm/scripts/rvm
$ rvm install 2.6.3
$ rvm use 2.6.3 --default
$ ruby -v

$ gem install rails -v 5.2.2
$ rails -v

Check the paths:

$ which -a gem
$ which -a ruby

Now you can Add some gems (inside you app directory):

$ gem install faker

All works great for me, hope this helps!