Why rvmsudo is needed to install passenger

280 views Asked by At

I have browsed around but unable to find why rvmsudo is needed for passenger installation.

I am installing passenger with nginx in my server and I'm using RVM. According to the passenger user manual I need to use rvmsudo to install passenger if I have rvm installed.

Whats the difference between using rvmsudo and without using rvmsudo. Is using rvmsudo to system wide install needed despite having rvm installed locally only ? (just use gem install passenger)

Thank You !

1

There are 1 answers

0
shivam On BEST ANSWER

sudo grants a command root permissions to the current user to carry a certain activity (given the user is allowed to use sudo). That said, on installing passenger you need root permission to install files at required locations.

One simple thing to do that comes to mind instantly is:

sudo rvm passenger-install-nginx-module

This won't work! Here's the explanation:

However, this won't work at all. sudo will start a new subshell. That new subshell's environment will be completely different, and won't contain RVM, nor will it have access to your user's RVM without trying to hack in RVM's environment variables yourself.

Therefore you are required to use the solution provided by RVM i.e. rvmsudo. It will pass on any environment variables that RVM set up to get you to the correct Ruby along with sudo privileges, which is exactly what you need to install passenger in this example.