rvm is not working

August 24, 2013 7.7k views
New Digital Ocean customer here. Need some rvm help. This is what I've done so far: - 1-Click Install Ruby on Rails on Ubuntu 12.10. - Initial Server Setup with Ubuntu 12.04. From my home directory /home/ltrainpr I type rvm install 2.0.0 and get this error: mkdir: cannot create directory `/usr/local/rvm/log/ruby-2.0.0-p195': Permission denied Could not detect ruby version/name for installation, please be more specific. I tried rvmsudo install 2.0.0 and get this error: Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. Run: export rvmsudo_secure_path=1 to avoid the warning, put it in shell initialization file to make it persistent. In case there is no `secure_path` in `/etc/sudoers`. Run: export rvmsudo_secure_path=0 to avoid the warning, put it in shell initialization file to make it persistent. [sudo] password for ltrainpr: install: missing destination file operand after `2.0.0' Try `install --help' for more information. I tried the command: rvm use ruby 2.0.0-p195 --default and got this error: mkdir: cannot create directory `/usr/local/rvm/log/ruby-2.0.0-p195': Permission denied Tried rvmsudo use ruby 2.0.0-p195 --default and got this error: /usr/bin/env: use: No such file or directory When I do rvm list, I get: rvm rubies =* ruby-1.9.3-p429 [ x86_64 ] # => - current # =* - current && default # * - default When I run sudo I get: sudo: rvm: command not found I would like to use ruby 2.0.0 with rvm. What do I need to do? What am I missing? rvm file is under usr/local/rvm
2 Answers
The image is already set up with a 'rails' user -- it's recommended that you use that user instead.

If you still want to use the 'ltrainpr' user, run these commands as root:

usermod -a -G sudo ltrainpr

usermod -s /bin/bash ltrainpr


Then log in as ltrainpr and run this command:

/bin/bash --login


It'll spawn a login shell, once you're inside, run these commands:

sudo /usr/local/rvm/bin/rvm get stable

sudo /usr/local/rvm/bin/rvm install 2.0.0
rvm requirements
rvm use --default 2.0.0


That should fix it. :]
I'm not very familiar with ruby/rvm so I suggest creating a one-click ruby installation droplet and sticking to the defaults (e.g. renaming a home dir is bad).
Have another answer? Share your knowledge.