问题
I'm setting up a server, it's an Ubuntu 12.04
first I installed RVM multi-user:
me@ubuntu$ \curl -L https://get.rvm.io | sudo bash -s stable
then after RVM installed, as the installation suggests I added myself to RVM group
usermod -a -G me rvm
installed ruby
rvm insall 1.9.3 --default
then I tried to install system wide gem passenger and I get this:
me@ubuntu:~$ rvmsudo gem install passenger
sudo: gem: command not found
In fact any command run with rvmsudo
just says sudo : {command}: not found
I need gems to be installed system wide, because it's a production server setup, also installing passenger-install-nginx-module
requires root permissions as it installs int to /opt/nginx/
any thoughts?
回答1:
Maybe this bug affects you.
Instead of waiting for a fixed release you might install an older version of rvm:
\curl -L https://get.rvm.io | sudo bash -s -- --version 1.16.20
See https://rvm.io/rvm/install/ for details.
EDIT: This issue is now solved. rvmsudo
is working for me (Ubuntu 12.04).
回答2:
I was having this same problem today too, and instead of waiting for the fix or installing an older version of rvm, I patched my rvmsudo file back to 1.16.x and left the rest of rvm alone.
first double check where rvmsudo is located on your system:
> which rvmsudo
/usr/local/rvm/bin/rvmsudo
then replace it with the version from 1.16.x
curl https://raw.github.com/wayneeseguin/rvm/eef67d80409ee3291de83ec4f070bed5aaca6d41/binscripts/rvmsudo > /path/to/rvmsudo
Note: I actually tried first updating to the latest version of rvm, since the issue that @trobter links to above in rvm's github account is marked as fixed, but the fix doesn't fully resolve the issue, so then I searched through their github account for the version of rvmsudo from 1.16.x, which did work.
回答3:
I think it may be because you did not add yourself to the rvm group. You said:
usermod -a -G me rvm
What it should be is:
usermod -a -G rvm me
In addition, I needed to add the following line to the end of my .bashrc
:
[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # This loads RVM into a shell session.
After that, just log into your shell again.
回答4:
Give rvmsudo the full path to your gem command?
来源:https://stackoverflow.com/questions/13544939/sudo-rvm-command-not-found-rvm-multiuser-install-on-ubuntu-12-04-server