Project

General

Profile

Actions

Feature #11731

closed

Make ruby gem install to user-install by default

Added by kallisti5 (Alexander von Gluck) over 8 years ago. Updated over 8 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
[ruby-core:71630]

Description

Installing gem's system-wide doesn't make sense 99% of the time...

  • Linux -- Need root access via sudo
  • Windows -- Need administrator
  • Max OS X -- Need root access via sudo
  • Haiku -- /boot/system read-only

gem currently installs gems system-wide by default

Since the most common use-case is to install gems for your own
user, why doesn't gem --user-directory by default?

Tools like rvm already set this manually.

Making --user-directory default means package maintainers only
need to --no-user-directory while everyone else just gem install's

Updated by kallisti5 (Alexander von Gluck) over 8 years ago

There would be a few minor logic issues around gem looking for --install-dir + --user-directory and erroring out... that check would need to be changed to --no-user-directory + --install-dir

This definitely would need some discussion as it has a moderate scope (which tools using gem expect system-wide installation?)

To keep compatibility in logic, gem might need to detect the root/administrator user and install system-wide by default to ensure when someone sudo gem install XXX the gem isn't just installed for the root user.

Updated by mwpastore (Mike Pastore) over 8 years ago

Aren't most people using rvm or rbenv/bundler to address this need?

Updated by kallisti5 (Alexander von Gluck) over 8 years ago

yeah, the large number of workarounds show this is a pretty default workflow for people. Thus raises the question on why it isn't the default behavior.

Updated by phluid61 (Matthew Kerwin) over 8 years ago

On 23 November 2015 at 08:56, wrote:

Issue #11731 has been updated by Alexander von Gluck.

yeah, the large number of workarounds show this is a pretty default
workflow for people. Thus raises the question on why it isn't the default
behavior.

​Opinion, not fact: is it not the case that most folk who develop
independently usually do so where they either a) use rbenv or b) own the
machine and can sudo safely? And by contrast, the people who can't do
that are usually in corporate environments where site-wide installation
makes most sense?

Note that rbenv isn't just a workaround for this, it also allows
independent installation of entire Ruby environments, including
core/stdlib, parser, etc. So I don't know that we can say that there's
necessarily a large number of workarounds just for local gems.

--
Matthew Kerwin
http://matthew.kerwin.net.au/

Updated by kallisti5 (Alexander von Gluck) over 8 years ago

  • Subject changed from Make ruby gem install to user-directory by default to Make ruby gem install to user-install by default

Updated by kallisti5 (Alexander von Gluck) over 8 years ago

Shouldn't site-wide installations use packaged gem files as they install to /usr?
Installing non-packaged files to /usr violates the LSB.

A few linux distros seem to also set --user-install as default:
https://projects.archlinux.org/svntogit/packages.git/tree/trunk/gemrc?h=packages/ruby

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Status changed from Open to Third Party's Issue

Rubygems upstream is https://github.com/rubygems/rubygems.

Maybe to fallback to user-install when no permission to the default place.

BTW, is ruby installed under /boot filesystem, on Haiku?

Updated by kallisti5 (Alexander von Gluck) over 8 years ago

https://github.com/rubygems/rubygems/issues/1394 opened to track. Sorry for putting it in the wrong place.

Haiku is a little special. /boot represents the os "boot" drive (and not where only the kernel lives)
https://www.haiku-os.org/docs/userguide/en/filesystem-layout.html

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0