Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6750703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:50:24+00:00 2026-05-26T12:50:24+00:00

root@app1:~# gem -v 1.8.10 I get 1.8.10 when I use rvm. But when I

  • 0
root@app1:~# gem -v
1.8.10

I get 1.8.10 when I use rvm. But when I use sudo I get:

root@app1:~# sudo gem -v
1.3.7

Now when I install a gem on another user than root

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

Where does this go wrong?

Here is my gem env when i use no sudo

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 => true
 - :verbose => true
 - :benchmark => false
 - :backtrace => false
 - :bulk_threshold => 1000
 - "gem" => "--no-rdoc --no-ri"
 - "install" => "--no-ri --no-rdoc --env-shebang"
 - :sources => ["http://gemcutter.org", "http://gems.rubyforge.org/",   "http://gems.github.com"]
 - "update" => "--no-ri --no-rdoc --env-shebang"
 - REMOTE SOURCES:
   - http://gemcutter.org
   - http://gems.rubyforge.org/
   - http://gems.github.com

Here is my gem env when i use sudo

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 => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-rdoc --no-ri"
     - :sources => ["http://gemcutter.org", "http://gems.rubyforge.org/", "http://gems.github.com"]
     - "install" => "--no-ri --no-rdoc --env-shebang"
     - "update" => "--no-ri --no-rdoc --env-shebang"
  - REMOTE SOURCES:
     - http://gemcutter.org
     - http://gems.rubyforge.org/
     - http://gems.github.com 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:50:24+00:00Added an answer on May 26, 2026 at 12:50 pm

    Three things to note here:

    1. RVM works by maintaining a couple of environment variables. sudo clears most of them during user switch as a security measure to prevent attackers to inject dangerous variables like LD_PRELOAD into an elevated execution context. If you want to use sudo and want to retain your RVM environment inside the new shell, use rvmsudo instead.
    2. The gem environment you see as root is the system’s default. You get this, because, as explained in point one, sudo doesn’t retain RVM’s environment variables during user switching.
    3. The error during your gem installation attempt most probably stems from you don’t having the correct rights to write into the RVM directory. During a global installation, RVM creates a group called rvm and makes sure that all its members can write to the RVm directory which is requires to install rubies, create gemsets and install gems. Make sure your user is in that group. Or you could just use rvmsudo…
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[root@234571-app2 git]# ./test.py File ./test.py, line 4 with open(/home/git/post-receive-email.log,'a') as log_file: ^ SyntaxError: invalid
To refer to the root of a website in asp I use an ASP
[root@dev-test test]$ perl -e %hash=(key,1);print 1 if exists $hash{key}; exists argument is not a
[root@ test]$ cat return10.c #include <stdio.h> int main(int argc, char *argv[]){ return 10; }
root@ubuntu:/home/dj/workspace/TestProject# ant test Buildfile: /home/dj/workspace/TestProject/build.xml test: [junit] Testsuite: TestProject [junit] Tests run: 1, Failures:
Suppose I want to copy a file: scp abc root@10.10.1.1:/home/user/app_abc is there a way
root = Tk() w=350 h=200 # get screen width and height ws = root.winfo_screenwidth()
My root element is saved and all it's assocations, but the id of the
Root view is a UIImage View, it has subviews, those have subviews. My root
root@everton-laptop:/opt/tinyos-1.x/apps/Blink# make pc compiling Blink to a pc binary ncc -o build/pc/main.exe -g -O0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.