Why can't I perform a multi-user RVM installation on Ubuntu 11.04?

I am trying to install RVM in /usr/local/rvm because I need the ability to run ruby ​​as a server. However, whenever I run:

 bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) 

my home directory is /home/<user>/.rvm .

I tried to work:

 sudo bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) 

and also enable the Ubuntu root password and log in with the root account, but the installation is always by default related to my home directory. How can I fix this, or would it be easier to just install Ruby from the source code?

+4
source share
5 answers

In my opinion, RVM on a working host is not as useful as for a developer sandbox. I think RVM is a great tool, but it is not for every situation.

Developers need great flexibility to use different versions of Ruby and to use specific versions of gems. For this, the RVM shines. This allows you to easily switch automatically to test all installed versions of Ruby, or, if something is a thing of the past, release everything and start quickly.

In a production server environment, where you usually assign a host to a specific service or set of related services, the need to quickly switch between different sets of rubies and gems tends to disappear. I put only one version of Ruby on mine. All applications indicate this. IF I need more than one, I would install it in a separate directory hierarchy /opt or /local and set my PATH for the owner account to indicate the version you need. In production, which is usually set once and forgets about the situation.

+1
source

You can install rvm in multi-user mode on Ubuntu. The instructions are the same as for other systems, as described here http://beginrescueend.com/rvm/install/ Just install it using sudo .

However, another problem arises with Ubuntu, which will lead to the failure of subsequent commands like sudo rvm install 1.9.2 due to the way Ubuntu implements the sudo command. On ubuntu, sudo changes the default path to make it more secure. This earlier thread discusses in detail the issue of sudo modifying PATH - why?

To work around this issue, edit the sudoers file with visudo and add the option

 Defaults !secure_path 

as suggested in the corresponding thread.

+1
source

When you are logged in as root, do you set the rvm_path value:

 echo $rvm_path 

If so, then:

 export rvm_path= rm /etc/rvmrc 

That should be enough.

0
source

To make sure, try sudo su -c bash < <(...) . You can use sudo without having a root user account on the system (the way OSX was configured when I bought it), so you have to be careful with sudo. Also, for example, sudo su -c env has a different path than sudo env in my Ubuntu installation.

Also note that after installation (you cannot use the function) you need to use rvmsudo rvm ... instead of sudo rvm ... if you are not logged in as root (i.e. maybe you need sudo su your Job).

0
source

Instead of running commands using sudo or enabling the root password, try the following:

 $ sudo su - 

This will switch you to the root account, where you can run the installation command:

 # bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) 

It worked for me.

0
source

All Articles