title: remove ruby gems from system
body: <pre><code>root@app1:~# gem -v
  1.8.10
  </code></pre>
  
  <p>I get 1.8.10 when I use rvm. But when I use sudo I get:</p>
  
  <pre><code>root@app1:~# sudo gem -v
  1.3.7
  </code></pre>
  
  <p>Now when I install a gem on another user than root</p>
  
  <pre><code>test@app1:~$ gem install RedCloth
  Fetching: RedCloth-4.2.8.gem (100%)
  ERROR:  While executing gem ... (Errno::EACCES)
  Permission denied - /usr/local/rvm/gems/ree-1.8.7-2011.03/cache/RedCloth-4.2.8.gem
  </code></pre>
  
  <p>Where does this go wrong?</p>
  
  <p>Here is my gem env when i use no sudo</p>
  
  <pre><code>root@app1:~# gem env
  RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ree-1.8.7-2011.03
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ree-1.8.7-2011.03/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ree-1.8.7-2011.03/bin
  - RUBYGEMS PLATFORMS:
  - ruby
   - x86_64-linux
  - GEM PATHS:
   - /usr/local/rvm/gems/ree-1.8.7-2011.03
   - /usr/local/rvm/gems/ree-1.8.7-2011.03@global
  - GEM CONFIGURATION:
   - :update_sources =&gt; true
   - :verbose =&gt; true
   - :benchmark =&gt; false
   - :backtrace =&gt; false
   - :bulk_threshold =&gt; 1000
   - "gem" =&gt; "--no-rdoc --no-ri"
   - "install" =&gt; "--no-ri --no-rdoc --env-shebang"
   - :sources =&gt; ["http://gemcutter.org", "http://gems.rubyforge.org/",   "http://gems.github.com"]
   - "update" =&gt; "--no-ri --no-rdoc --env-shebang"
   - REMOTE SOURCES:
     - http://gemcutter.org
     - http://gems.rubyforge.org/
     - http://gems.github.com
  </code></pre>
  
  <p>Here is my gem env when i use sudo</p>
  
  <pre><code>root@app1:~# sudo gem env
  RubyGems Environment:
    - RUBYGEMS VERSION: 1.3.7
    - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
    - INSTALLATION DIRECTORY: /var/lib/gems/1.8
    - RUBY EXECUTABLE: /usr/bin/ruby1.8
    - EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
    - RUBYGEMS PLATFORMS:
      - ruby
      - x86_64-linux
    - GEM PATHS:
      - /var/lib/gems/1.8
      - /root/.gem/ruby/1.8
    - GEM CONFIGURATION:
       - :update_sources =&gt; true
       - :verbose =&gt; true
       - :benchmark =&gt; false
       - :backtrace =&gt; false
       - :bulk_threshold =&gt; 1000
       - "gem" =&gt; "--no-rdoc --no-ri"
       - :sources =&gt; ["http://gemcutter.org", "http://gems.rubyforge.org/", "http://gems.github.com"]
       - "install" =&gt; "--no-ri --no-rdoc --env-shebang"
       - "update" =&gt; "--no-ri --no-rdoc --env-shebang"
    - REMOTE SOURCES:
       - http://gemcutter.org
       - http://gems.rubyforge.org/
       - http://gems.github.com 
  </code></pre>