title: Ruby gem permission denied /var/lib/gems using Ubuntu
body: <p>I'm trying to install Rails using Gem and did the following from the terminal:</p>
  
  <pre><code>sudo apt-get install ruby-full build-essential
  sudo apt-get install rubygems
  export PATH=/var/lib/gems/1.8/bin:$PATH
  gem install rails
  </code></pre>
  
  <p>Then I get the following message:</p>
  
  <blockquote>
    <p>ERROR: While executing gem ... (Errno:EACCES)
    Permission denied - /var/lib/gems</p>
  </blockquote>
  
  <p>I've followed the instruction from <a href="https://help.ubuntu.com/community/RubyOnRails#Intro_Ubuntu_9.04_..._Apache2.2_tested_only">Ubuntu Help Guide</a> &amp; I'm using Oracle VM VirtualBox to run Ubuntu under Windows 7 and have RubyGems v1.8.15.</p>