tag:help.rubygems.org,2010-01-19:/discussions/problems/426-default-installation-prefix-should-be-usrlocal-on-unix-like-platformsRubyGems.org: Discussion 2011-08-04T17:37:54Ztag:help.rubygems.org,2010-01-19:Comment/42140222010-12-11T00:23:43Z2010-12-11T00:23:45ZDefault installation prefix should be /usr/local on UNIX-like platforms<div><p>That last line should read:</p>
<ol>
<li>Could you please make the default <code>/usr/local</code> as is
customary for source packages?</li>
</ol></div>Richard Crowleytag:help.rubygems.org,2010-01-19:Comment/42140222010-12-11T01:19:42Z2010-12-11T01:19:42ZDefault installation prefix should be /usr/local on UNIX-like platforms<div><p>RubyGems' installer is working as designed and desired.</p>
<p>RubyGems defaults to the paths that match your Ruby installation
from rbconfig.rb. It appears that your ruby is partially installed
in /usr and partially installed in /usr/local. RubyGems matches
this so everything will Just Work™. RubyGems depends heavily
upon the values set in rbconfig.rb at ruby compile time to locate
installed gems and executables in order to behave correctly and
remain properly self-contained when faced with multiple ruby
versions.</p>
<p>To be more specific, <code>gem</code> is installed next to the
<code>ruby</code> that was used to install it. This way the that
comes first in PATH will be able to load gems installed by the that
comes first in PATH, and any executable scripts installed by
RubyGems will use the correct installed gems.</p>
<p>The --prefix option is for users who wish to install multiple
copies of RubyGems. It behaves like autoconf's --prefix option for
configure scripts. Usually this means that RubyGems will not Just
Work™ when installed using --prefix without some extra
configuration and care by the user.</p>
<p>If /usr/local were the customary location for installation
RubyGems would not work out of the box as not every OS package of
Ruby works with Ruby's preferred install path of /usr/local. By
using the values in rbconfig.rb I can be assured that RubyGems will
work correctly on your platform.</p>
<p>If you wish to have be installed to /usr/local I suggest you
contact your Ruby packager and have them install in your preferred
path as well.</p></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/42140222010-12-11T09:52:38Z2010-12-11T09:52:38ZDefault installation prefix should be /usr/local on UNIX-like platforms<div><p>(I'm skipping backticks this time because of a bug in
Tender.)</p>
<p>The least surprising thing to do by default is install in
/usr/local on UNIX-like operating systems. PATH is a user-directed
adventure for which your package can't be held liable.
"/usr/local/bin/gem1.8" is not surprising.</p>
<blockquote>
<p>The --prefix option is for users who wish to install multiple
copies of RubyGems. It behaves like autoconf's --prefix option for
configure scripts. Usually this means that RubyGems will not Just
Work™ when installed using --prefix without some extra
configuration and care by the user.</p>
</blockquote>
<p>You're technically correct (the best kind of correct) that
--prefix works exactly like it does in an autoconf-enabled package.
The problem is, RubyGems is meaningless when installed in
autoconf-like directories. RubyGems wants to be installed on Ruby's
$:, which usually includes /usr/local/lib/site_ruby and
/usr/lib/vendor_ruby but not /usr/local/lib. It's perfectly OK to
throw loud errors if you can't find a directory that's both on $:
and within the prefix.</p>
<p>You're fucking over people who understand why UNIX is the way it
is and care that it is so by mixing /usr and /usr/local. Please
stop.</p>
<ol>
<li>Please fix --prefix to work properly. By properly I mean only
touching files within --prefix while still keeping to Ruby's
$:.<br></li>
<li>Please make /usr/local the default prefix for installations
from source. This is how every other source package in the world
works. Don't be surprising.</li>
</ol></div>Richard Crowleytag:help.rubygems.org,2010-01-19:Comment/42140222010-12-12T00:02:40Z2010-12-12T00:02:40ZDefault installation prefix should be /usr/local on UNIX-like platforms<div><p>To clarify, --prefix installs into autoconf-like directories
such that ruby -I can use them easily.</p>
<p>The current behavior is considered correct and will not be
changed.</p></div>Eric Hodel