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 415255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:21:47+00:00 2026-05-12T18:21:47+00:00

If you don’t install gems with sudo on a mac, by default they will

  • 0

If you don’t install gems with sudo on a mac, by default they will be placed in a directory like

.gem/ruby/1.8/gems/

If you DO install by with sudo, my understanding is they are normally placed in the system directories, like so:

 /usr/local/lib/ruby/gems/1.8/gems/

Is there a good reason you should install gems with sudo instead, other than simply letting others share them with you? *

I’m under the impression that you’d sudo install gems because if you as user bob install the gems inside bob‘s directory, then a user like www-data (used by Passenger/Apache on Ubuntu Linux when serving files), to use them – is this the only reason you’d use them like this?

Or is best practice now to use something like Ruby Version Manager instead now?

I’d really appreciate hearing from some more experienced ruby developers about where you store yours and why.

  • 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-12T18:21:47+00:00Added an answer on May 12, 2026 at 6:21 pm

    Running gem install with sudo means you are running the install as an admin user and as such will install it for the whole system. If you run as a normal user it will just put the gems in your home directory.

    For your development machine or server, /usr/local/lib/ruby/gems/1.8/gems/ is almost certainly the right place to put gems. If you are on some kind of shared hosting or playing around with development versions of some gems, by all means, keep them in your home directory so you don’t clutter up the system for other users.

    I haven’t heard of Ruby Version Manager before. I’ll check it out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't understand the meaning of $:<< . in Ruby. I upgraded Ruby to
Don't they both have to convert to machine code at some point to execute
Don't know if this is the right place to ask this, but I will
I don't know if this has been asked before, but what i'd like to
I don't like Jackson. I want to use ajax but with Google Gson. So
Don't need to go so far, just install Devexpress 11.2.5 and run the GridDemo(
don't know better title for this, but here's my code. I have class user
Don't be scared of the extensive code. The problem is general. I just provided
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
Don't really know how to formulate the title, but it should be pretty obvious

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.