Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When install rails with

sudo gem install rails

or with root user, this install in $HOME/.gem and only works for actual user, how install for all users in the system ?

share|improve this question
up vote 3 down vote accepted

You might need to change your /etc/gemrc or /root/.gemrc. The default is set to

gem: --user-install

Which does exactly what you observed. You can use

gem install --no-user-install rails

See Arch Wiki: Ruby.

install-packages-through-apt-get-or-gem is about the decision to use a package manager or gem. Using pacman is the same as using apt-get in this case.


As mentioned by Hans: Another option to use pacgem to build an Arch Linux package from a gem on the fly.

share|improve this answer

You can use pacgem which is available in AUR:

share|improve this answer

If you're installing files system-wide, always use your package manager for it. Always, always, always. ruby-rails is available in the AUR, and it will install as system-wide. Read about how to install packages from the AUR and perform the aforementioned with this package.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.