Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had the original issue reported in this question, "<strong>mkdir: cannot create directory `/usr/local/rvm': Permission denied</strong>" when trying to install rvm.</p> <p>This is my scenario and how I solved it - maybe this will help others with this same issue.</p> <p>I have Ubuntu 11.04 installed on a laptop, I only have 1 user, the one I created at install time, named nathan. When I would try to install rvm as nathan, the rvm installer saw me as root and kept trying to install rvm globally, but since I wasn't really root, it couldn't get access to create directories in /usr/local/rvm.</p> <p>I'm far from an expert with Ubuntu, so I'm sure there are easier/better ways to accomplish the things I did (and I would love to learn about them), but this worked for me:</p> <ol> <li>I created a new user called rubydev</li> <li><p>I logged in as rubydev, opened a terminal and typed:</p> <pre><code>rubydev~$ bash &lt; &lt;(curl -B http://rvm.beginrescueend.com/install/rvm) </code></pre></li> <li><p>rvm installed correctly and I logged out of rubydev</p></li> <li>Signed back in as nathan, opened a terminal and typed "su" (you could do all this with sudo, I am lazy)</li> <li><p>After successfully getting root, I typed the following commands:</p> <pre><code>root: /home/nathan# cp -R /home/rubydev/.rvm . root: /home/nathan# chown -R nathan .rvm root: /home/nathan# chgrp -R nathan .rvm root: /home/nathan# exit nathan~$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] &amp;&amp; . "$HOME/.rvm/scripts/rvm" # Load RVM function' &gt;&gt; ~/.bash_profile nathan~$ echo 'export rvm_path="/home/nathan/.rvm"' &gt; ~/.rvmrc nathan~$ source .bash_profile </code></pre></li> <li><p>At this point, rvm was correctly installed under my home directory. To verify I typed:</p> <pre><code>nathan~$ type rvm | head -1 rvm is a function (if you don't get this response, something else is wrong) </code></pre></li> <li><p>Read the notes and installed any dependencies</p> <pre><code>nathan~$ rvm notes </code></pre></li> <li><p>I installed some rubies</p> <pre><code>nathan~$ rvm install 1.8.7-head nathan~$ rvm install 1.9.2-head </code></pre></li> <li><p>Verified install</p> <pre><code> nathan~$ rvm list rvm rubies ruby-1.8.7-head [x86_64] ruby-1.9.2-head [x86_64] nathan~$ rvm use 1.9.2 using /home/nathan/.rvm/gems/ruby-1.9.2-head nathan~$ rvm list rvm rubies ruby-1.8.7-head [x86_x64] =&gt; ruby-1.9.2-head [x86_x64] </code></pre></li> <li><p>Finally, I edited the preferences on the terminal itself to ensure the "Run command as as login shell" under the "Title and Command" tab was checked. It seems .bash_profile isn't otherwise processed.</p></li> <li><p>I removed the rubydev user I created in step 1.</p></li> </ol> <p>With all of that, I have a working rvm under Ubuntu 11.04 using my preferred username.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload