0
votes

I am trying to deploy my app to a VPS with capistrano, rvm, passenger & nginx.

I already had installed nginx via apt-get on Debian6.

Now it appears as though to install passenger and to run passenger-install-nginx-module I have to run both commands as sudo according to modrails site.

The problem is that I installed rvm system wide using sudo. Now it doesn't seem to allow sudo gem installs. I am having a tough time understanding all the ins & outs of rvm.

For example this link http://blog.ninjahideout.com/posts/the-path-to-better-rvm-and-passenger-integration suggests updating rvm by

rvm update --head

That gives the error:

ERROR: rvm update has been removed. See 'rvm get' and rvm 'rubygems' CLI API instead

So one thing leads to another error and another thing which needs upgrading etc. I would really like some help with these questions:

  • On a server should rvm be installed using sudo?
  • If not I won't be able to run the passenger module installation commands.
  • rvm web site strongly discourages system wide installs as written on https://rvm.io/rubies/rubygems/. When it IS installed system wide how do you run sudo gem install passenger?

I feel I am in a catch-22 situation here. Thanks in advance for any help.

1
I did a bit more digging and used rvmsudo to install both and it worked! - bytemonger

1 Answers

0
votes

You should never use sudo with RVM, it loses all shell variables - including those needed for RVM / Ruby to work correctly.

To update RVM run:

rvm get head
rvm reload

For installing gems when RVM is installed in /usr/local/rvm make sure your user is in rvm group, you can verify it with:

id

Here is the best practices deployment using RVM and SM Framework.